james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rouaz...@apache.org
Subject [49/50] [abbrv] james-project git commit: JAMES-1877 Use placeholder with loggers
Date Tue, 10 Jan 2017 14:19:04 GMT
JAMES-1877 Use placeholder with loggers


Project: http://git-wip-us.apache.org/repos/asf/james-project/repo
Commit: http://git-wip-us.apache.org/repos/asf/james-project/commit/c80de0e0
Tree: http://git-wip-us.apache.org/repos/asf/james-project/tree/c80de0e0
Diff: http://git-wip-us.apache.org/repos/asf/james-project/diff/c80de0e0

Branch: refs/heads/master
Commit: c80de0e041052f8ac6937e310c49b5a59528f861
Parents: d584c13
Author: Benoit Tellier <btellier@linagora.com>
Authored: Tue Jan 10 14:58:56 2017 +0700
Committer: Benoit Tellier <btellier@linagora.com>
Committed: Tue Jan 10 18:14:32 2017 +0700

----------------------------------------------------------------------
 .../AddressesArrayToMailAddressListConverter.java              | 2 +-
 .../transport/mailets/remoteDelivery/DeliveryRunnable.java     | 6 +++---
 .../mailets/remoteDelivery/RemoteDeliveryConfiguration.java    | 6 +++---
 3 files changed, 7 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/james-project/blob/c80de0e0/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/remoteDelivery/AddressesArrayToMailAddressListConverter.java
----------------------------------------------------------------------
diff --git a/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/remoteDelivery/AddressesArrayToMailAddressListConverter.java
b/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/remoteDelivery/AddressesArrayToMailAddressListConverter.java
index d468947..8d7dcec 100644
--- a/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/remoteDelivery/AddressesArrayToMailAddressListConverter.java
+++ b/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/remoteDelivery/AddressesArrayToMailAddressListConverter.java
@@ -46,7 +46,7 @@ public class AddressesArrayToMailAddressListConverter {
                 try {
                     return Optional.of(new MailAddress(input.toString()));
                 } catch (AddressException e) {
-                    logger.debug("Can't parse unsent address: " + e.getMessage());
+                    logger.debug("Can't parse unsent address: {}", e.getMessage());
                     return Optional.absent();
                 }
             }

http://git-wip-us.apache.org/repos/asf/james-project/blob/c80de0e0/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/remoteDelivery/DeliveryRunnable.java
----------------------------------------------------------------------
diff --git a/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/remoteDelivery/DeliveryRunnable.java
b/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/remoteDelivery/DeliveryRunnable.java
index 4841402..a7cf23b 100644
--- a/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/remoteDelivery/DeliveryRunnable.java
+++ b/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/remoteDelivery/DeliveryRunnable.java
@@ -96,7 +96,7 @@ public class DeliveryRunnable implements Runnable {
 
             try {
                 if (configuration.isDebug()) {
-                    logger.debug(Thread.currentThread().getName() + " will process mail "
+ mail.getName());
+                    logger.debug("{} will process mail {}", Thread.currentThread().getName(),
mail.getName());
                 }
                 attemptDelivery(mail);
                 LifecycleUtil.dispose(mail);
@@ -146,13 +146,13 @@ public class DeliveryRunnable implements Runnable {
         if (retries < configuration.getMaxRetries()) {
             reAttemptDelivery(mail, retries);
         } else {
-            logger.debug("Bouncing message " + mail.getName() + " after " + retries + " retries");
+            logger.debug("Bouncing message {} after {} retries", mail.getName(), retries);
             bouncer.bounce(mail, new Exception("Too many retries failure. Bouncing after
" + retries + " retries.", executionResult.getException().orNull()));
         }
     }
 
     private void reAttemptDelivery(Mail mail, int retries) throws MailQueue.MailQueueException
{
-        logger.debug("Storing message " + mail.getName() + " into outgoing after " + retries
+ " retries");
+        logger.debug("Storing message {} into outgoing after {} retries", mail.getName(),
retries);
         DeliveryRetriesHelper.incrementRetries(mail);
         mail.setLastUpdated(dateSupplier.get());
         // Something happened that will delay delivery. Store it back in the retry repository.

http://git-wip-us.apache.org/repos/asf/james-project/blob/c80de0e0/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/remoteDelivery/RemoteDeliveryConfiguration.java
----------------------------------------------------------------------
diff --git a/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/remoteDelivery/RemoteDeliveryConfiguration.java
b/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/remoteDelivery/RemoteDeliveryConfiguration.java
index 3bfde9e..9b5fb58 100644
--- a/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/remoteDelivery/RemoteDeliveryConfiguration.java
+++ b/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/remoteDelivery/RemoteDeliveryConfiguration.java
@@ -146,7 +146,7 @@ public class RemoteDeliveryConfiguration {
                 Optional.fromNullable(mailetConfig.getInitParameter(CONNECTIONTIMEOUT))
                     .or(String.valueOf(DEFAULT_CONNECTION_TIMEOUT)));
         } catch (Exception e) {
-            LOGGER.warn("Invalid timeout setting: " + mailetConfig.getInitParameter(TIMEOUT));
+            LOGGER.warn("Invalid timeout setting: {}", mailetConfig.getInitParameter(TIMEOUT));
             return DEFAULT_CONNECTION_TIMEOUT;
         }
     }
@@ -159,7 +159,7 @@ public class RemoteDeliveryConfiguration {
                 return DEFAULT_SMTP_TIMEOUT;
             }
         } catch (Exception e) {
-            LOGGER.warn("Invalid timeout setting: " + mailetConfig.getInitParameter(TIMEOUT));
+            LOGGER.warn("Invalid timeout setting: {}", mailetConfig.getInitParameter(TIMEOUT));
             return DEFAULT_SMTP_TIMEOUT;
         }
     }
@@ -171,7 +171,7 @@ public class RemoteDeliveryConfiguration {
                     .or(String.valueOf(DEFAULT_MAX_RETRY)));
             return DelaysAndMaxRetry.from(intendedMaxRetries, mailetConfig.getInitParameter(DELAY_TIME));
         } catch (Exception e) {
-            LOGGER.warn("Invalid maxRetries setting: " + mailetConfig.getInitParameter(MAX_RETRIES));
+            LOGGER.warn("Invalid maxRetries setting: {}", mailetConfig.getInitParameter(MAX_RETRIES));
             return DelaysAndMaxRetry.defaults();
         }
     }


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


Mime
View raw message