james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From adup...@apache.org
Subject [22/34] james-project git commit: JAMES-2085 Enhance a bit log formatting
Date Wed, 05 Jul 2017 13:59:29 GMT
JAMES-2085 Enhance a bit log formatting


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

Branch: refs/heads/master
Commit: ad20e72a3a6d7f1283b86ee512469f969b89a5fa
Parents: 0d92911
Author: benwa <btellier@linagora.com>
Authored: Mon Jul 3 17:04:25 2017 +0700
Committer: benwa <btellier@linagora.com>
Committed: Wed Jul 5 17:13:48 2017 +0700

----------------------------------------------------------------------
 .../mailrepositorystore/MailRepositoryStoreBeanFactory.java | 9 +--------
 .../AddressesArrayToMailAddressListConverter.java           | 2 +-
 .../apache/james/imapserver/netty/ImapIdleStateHandler.java | 4 +++-
 .../lib/netty/AbstractConfigurableAsyncServer.java          | 9 +++------
 4 files changed, 8 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/james-project/blob/ad20e72a/server/container/spring/src/main/java/org/apache/james/container/spring/bean/factory/mailrepositorystore/MailRepositoryStoreBeanFactory.java
----------------------------------------------------------------------
diff --git a/server/container/spring/src/main/java/org/apache/james/container/spring/bean/factory/mailrepositorystore/MailRepositoryStoreBeanFactory.java
b/server/container/spring/src/main/java/org/apache/james/container/spring/bean/factory/mailrepositorystore/MailRepositoryStoreBeanFactory.java
index 65e0b78..3ef99be 100644
--- a/server/container/spring/src/main/java/org/apache/james/container/spring/bean/factory/mailrepositorystore/MailRepositoryStoreBeanFactory.java
+++ b/server/container/spring/src/main/java/org/apache/james/container/spring/bean/factory/mailrepositorystore/MailRepositoryStoreBeanFactory.java
@@ -122,14 +122,7 @@ public class MailRepositoryStoreBeanFactory extends AbstractBeanFactory
implemen
             }
 
             if (infoEnabled) {
-                StringBuilder infoBuffer = new StringBuilder(128);
-                infoBuffer.append("Registering Repository instance of class ");
-                infoBuffer.append(className);
-                infoBuffer.append(" to handle ");
-                infoBuffer.append(protocol);
-                infoBuffer.append(" protocol requests for repositories with key ");
-                infoBuffer.append(protocol);
-                getLogger().info(infoBuffer.toString());
+                getLogger().info("Registering Repository instance of class {} to handle {}
protocol requests", className, protocol);
             }
 
             if (classes.get(protocol) != null) {

http://git-wip-us.apache.org/repos/asf/james-project/blob/ad20e72a/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 8d7dcec..1f308bb 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 " + input, e);
                     return Optional.absent();
                 }
             }

http://git-wip-us.apache.org/repos/asf/james-project/blob/ad20e72a/server/protocols/protocols-imap4/src/main/java/org/apache/james/imapserver/netty/ImapIdleStateHandler.java
----------------------------------------------------------------------
diff --git a/server/protocols/protocols-imap4/src/main/java/org/apache/james/imapserver/netty/ImapIdleStateHandler.java
b/server/protocols/protocols-imap4/src/main/java/org/apache/james/imapserver/netty/ImapIdleStateHandler.java
index a77c00e..fd27f8d 100644
--- a/server/protocols/protocols-imap4/src/main/java/org/apache/james/imapserver/netty/ImapIdleStateHandler.java
+++ b/server/protocols/protocols-imap4/src/main/java/org/apache/james/imapserver/netty/ImapIdleStateHandler.java
@@ -40,7 +40,9 @@ public class ImapIdleStateHandler extends IdleStateAwareChannelHandler implement
             ImapSession session = (ImapSession) attributes.get(ctx.getChannel());
             InetSocketAddress address = (InetSocketAddress) ctx.getChannel().getRemoteAddress();
 
-            session.getLog().info("Logout client " + address.getHostName() + " (" + address.getAddress().getHostAddress()
+ ") because it idled for too long...");
+            session.getLog().info("Logout client {} ({}) because it idled for too long...",
+                address.getHostName(),
+                address.getAddress().getHostAddress());
 
             // logout the client
             session.logout();

http://git-wip-us.apache.org/repos/asf/james-project/blob/ad20e72a/server/protocols/protocols-library/src/main/java/org/apache/james/protocols/lib/netty/AbstractConfigurableAsyncServer.java
----------------------------------------------------------------------
diff --git a/server/protocols/protocols-library/src/main/java/org/apache/james/protocols/lib/netty/AbstractConfigurableAsyncServer.java
b/server/protocols/protocols-library/src/main/java/org/apache/james/protocols/lib/netty/AbstractConfigurableAsyncServer.java
index 211dd74..4556ea2 100644
--- a/server/protocols/protocols-library/src/main/java/org/apache/james/protocols/lib/netty/AbstractConfigurableAsyncServer.java
+++ b/server/protocols/protocols-library/src/main/java/org/apache/james/protocols/lib/netty/AbstractConfigurableAsyncServer.java
@@ -185,8 +185,7 @@ public abstract class AbstractConfigurableAsyncServer extends AbstractAsyncServe
             }
             address = new InetSocketAddress(ip, port);
 
-            String infoBuffer = getServiceType() + " bound to: " + ip + ":" + port;
-            logger.info(infoBuffer);
+            logger.info(getServiceType() + " bound to: " + ip + ":" + port);
 
             bindAddresses.add(address);
         }
@@ -346,8 +345,7 @@ public abstract class AbstractConfigurableAsyncServer extends AbstractAsyncServe
             hostName = "localhost";
         }
 
-        infoBuffer = new StringBuilder(64).append(getServiceType()).append(" is running on:
").append(hostName);
-        getLogger().info(infoBuffer.toString());
+        getLogger().info("{} is running on: {}", getServiceType(), hostName);
 
         boolean autodetect = handlerConfiguration.getBoolean(HELLO_NAME + ".[@autodetect]",
true);
         if (autodetect) {
@@ -359,8 +357,7 @@ public abstract class AbstractConfigurableAsyncServer extends AbstractAsyncServe
             }
         }
 
-        infoBuffer = new StringBuilder(64).append(getServiceType()).append(" handler hello
name is: ").append(helloName);
-        getLogger().info(infoBuffer.toString());
+        getLogger().info("{} handler hello name is: {}", getServiceType(), helloName);
     }
 
     /**


---------------------------------------------------------------------
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