james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From adup...@apache.org
Subject [28/34] james-project git commit: JAMES-2085 Run intellij code inspection to find where log messages can be enhanced
Date Wed, 05 Jul 2017 13:59:35 GMT
JAMES-2085 Run intellij code inspection to find where log messages can be enhanced


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

Branch: refs/heads/master
Commit: fb09b562114c8480c76c62b795cc4bab78a472ab
Parents: 7342623
Author: benwa <btellier@linagora.com>
Authored: Mon Jul 3 18:18:58 2017 +0700
Committer: benwa <btellier@linagora.com>
Committed: Wed Jul 5 17:13:49 2017 +0700

----------------------------------------------------------------------
 .../store/json/event/dto/MessageMetaDataDataTransferObject.java  | 2 +-
 .../java/org/apache/james/imap/processor/SearchProcessor.java    | 2 +-
 .../org/apache/james/imap/processor/fetch/EnvelopeBuilder.java   | 2 +-
 .../org/apache/james/mailrepository/file/FileMailRepository.java | 3 +--
 .../java/org/apache/james/dnsservice/dnsjava/DNSJavaService.java | 2 +-
 .../james/mailetcontainer/lib/AbstractStateMailetProcessor.java  | 4 ++--
 .../java/org/apache/james/jmap/send/PostDequeueDecorator.java    | 2 +-
 .../protocols/lib/netty/AbstractConfigurableAsyncServer.java     | 2 +-
 8 files changed, 9 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/james-project/blob/fb09b562/mailbox/store/src/main/java/org/apache/james/mailbox/store/json/event/dto/MessageMetaDataDataTransferObject.java
----------------------------------------------------------------------
diff --git a/mailbox/store/src/main/java/org/apache/james/mailbox/store/json/event/dto/MessageMetaDataDataTransferObject.java
b/mailbox/store/src/main/java/org/apache/james/mailbox/store/json/event/dto/MessageMetaDataDataTransferObject.java
index 299f906..e7c3e93 100644
--- a/mailbox/store/src/main/java/org/apache/james/mailbox/store/json/event/dto/MessageMetaDataDataTransferObject.java
+++ b/mailbox/store/src/main/java/org/apache/james/mailbox/store/json/event/dto/MessageMetaDataDataTransferObject.java
@@ -91,7 +91,7 @@ public class MessageMetaDataDataTransferObject {
         try {
             return new SimpleMessageMetaData(MessageUid.of(uid), modseq, flags.getFlags(),
size, parse(date), messageId);
         } catch(ParseException parseException) {
-            LOG.error("Parse exception while parsing date while deserializing metadata upon
event serialization. Using nowadays date instead.");
+            LOG.error("Parse exception while parsing date while deserializing metadata upon
event serialization. Using nowadays date instead.", parseException);
             return new SimpleMessageMetaData(MessageUid.of(uid), modseq, flags.getFlags(),
size, new Date(), messageId);
         }
 

http://git-wip-us.apache.org/repos/asf/james-project/blob/fb09b562/protocols/imap/src/main/java/org/apache/james/imap/processor/SearchProcessor.java
----------------------------------------------------------------------
diff --git a/protocols/imap/src/main/java/org/apache/james/imap/processor/SearchProcessor.java
b/protocols/imap/src/main/java/org/apache/james/imap/processor/SearchProcessor.java
index cce35f8..2b556e4 100644
--- a/protocols/imap/src/main/java/org/apache/james/imap/processor/SearchProcessor.java
+++ b/protocols/imap/src/main/java/org/apache/james/imap/processor/SearchProcessor.java
@@ -370,7 +370,7 @@ public class SearchProcessor extends AbstractMailboxProcessor<SearchRequest>
imp
             long modSeq = key.getModSeq();
             return SearchQuery.or(SearchQuery.modSeqEquals(modSeq), SearchQuery.modSeqGreaterThan(modSeq));
         default:
-            session.getLog().warn("Ignoring unknown search key.");
+            session.getLog().warn("Ignoring unknown search key " + type);
             return SearchQuery.all();
         }
     }

http://git-wip-us.apache.org/repos/asf/james-project/blob/fb09b562/protocols/imap/src/main/java/org/apache/james/imap/processor/fetch/EnvelopeBuilder.java
----------------------------------------------------------------------
diff --git a/protocols/imap/src/main/java/org/apache/james/imap/processor/fetch/EnvelopeBuilder.java
b/protocols/imap/src/main/java/org/apache/james/imap/processor/fetch/EnvelopeBuilder.java
index 6b02a7c..b658d51 100644
--- a/protocols/imap/src/main/java/org/apache/james/imap/processor/fetch/EnvelopeBuilder.java
+++ b/protocols/imap/src/main/java/org/apache/james/imap/processor/fetch/EnvelopeBuilder.java
@@ -145,7 +145,7 @@ public final class EnvelopeBuilder {
                         addresses.add(mailboxAddress);
 
                     } else {
-                        logger.warn("Unknown address type");
+                        logger.warn("Unknown address type " + address.getClass());
                     }
                 }
 

http://git-wip-us.apache.org/repos/asf/james-project/blob/fb09b562/server/data/data-file/src/main/java/org/apache/james/mailrepository/file/FileMailRepository.java
----------------------------------------------------------------------
diff --git a/server/data/data-file/src/main/java/org/apache/james/mailrepository/file/FileMailRepository.java
b/server/data/data-file/src/main/java/org/apache/james/mailrepository/file/FileMailRepository.java
index 00f04aa..d92b20e 100644
--- a/server/data/data-file/src/main/java/org/apache/james/mailrepository/file/FileMailRepository.java
+++ b/server/data/data-file/src/main/java/org/apache/james/mailrepository/file/FileMailRepository.java
@@ -235,8 +235,7 @@ public class FileMailRepository extends AbstractMailRepository {
                     remove(key);
                 }
                 final String errorMessage = exceptionBuffer.toString();
-                getLogger().warn(errorMessage);
-                getLogger().debug(errorMessage, re);
+                getLogger().warn(errorMessage, re);
                 return null;
             }
             MimeMessageStreamRepositorySource source = new MimeMessageStreamRepositorySource(streamRepository,
destination, key);

http://git-wip-us.apache.org/repos/asf/james-project/blob/fb09b562/server/dns-service/dnsservice-dnsjava/src/main/java/org/apache/james/dnsservice/dnsjava/DNSJavaService.java
----------------------------------------------------------------------
diff --git a/server/dns-service/dnsservice-dnsjava/src/main/java/org/apache/james/dnsservice/dnsjava/DNSJavaService.java
b/server/dns-service/dnsservice-dnsjava/src/main/java/org/apache/james/dnsservice/dnsjava/DNSJavaService.java
index fafc072..ff0cf09 100644
--- a/server/dns-service/dnsservice-dnsjava/src/main/java/org/apache/james/dnsservice/dnsjava/DNSJavaService.java
+++ b/server/dns-service/dnsservice-dnsjava/src/main/java/org/apache/james/dnsservice/dnsjava/DNSJavaService.java
@@ -337,7 +337,7 @@ public class DNSJavaService implements DNSService, DNSServiceMBean, LogEnabled,
                     // so we can't add it to the server list. In this
                     // case we return an empty list of servers
                     logBuffer = new StringBuffer(128).append("Couldn't resolve IP address
for host ").append(hostname).append(".");
-                    logger.error(logBuffer.toString());
+                    logger.error(logBuffer.toString(), uhe);
                 }
             }
             timeMetric.stopAndPublish();

http://git-wip-us.apache.org/repos/asf/james-project/blob/fb09b562/server/mailet/mailetcontainer-camel/src/main/java/org/apache/james/mailetcontainer/lib/AbstractStateMailetProcessor.java
----------------------------------------------------------------------
diff --git a/server/mailet/mailetcontainer-camel/src/main/java/org/apache/james/mailetcontainer/lib/AbstractStateMailetProcessor.java
b/server/mailet/mailetcontainer-camel/src/main/java/org/apache/james/mailetcontainer/lib/AbstractStateMailetProcessor.java
index ab84ba1..1580014 100644
--- a/server/mailet/mailetcontainer-camel/src/main/java/org/apache/james/mailetcontainer/lib/AbstractStateMailetProcessor.java
+++ b/server/mailet/mailetcontainer-camel/src/main/java/org/apache/james/mailetcontainer/lib/AbstractStateMailetProcessor.java
@@ -429,8 +429,8 @@ public abstract class AbstractStateMailetProcessor implements MailProcessor,
Con
                 // error processor. That is currently the
                 // normal situation for James, and the message
                 // will show up in the error store.
-                String warnBuffer = "Message " + mail.getName() + " reached the end of this
processor, and is automatically deleted.  This may indicate a configuration error.";
-                logger.warn(warnBuffer.toString());
+                logger.warn("Message " + mail.getName() + " reached the end of this processor,
and is automatically deleted." +
+                    "  This may indicate a configuration error.");
             }
 
             // Set the mail to ghost state

http://git-wip-us.apache.org/repos/asf/james-project/blob/fb09b562/server/protocols/jmap/src/main/java/org/apache/james/jmap/send/PostDequeueDecorator.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap/src/main/java/org/apache/james/jmap/send/PostDequeueDecorator.java
b/server/protocols/jmap/src/main/java/org/apache/james/jmap/send/PostDequeueDecorator.java
index 5631c83..ab42ce3 100644
--- a/server/protocols/jmap/src/main/java/org/apache/james/jmap/send/PostDequeueDecorator.java
+++ b/server/protocols/jmap/src/main/java/org/apache/james/jmap/send/PostDequeueDecorator.java
@@ -102,7 +102,7 @@ public class PostDequeueDecorator extends MailQueueItemDecorator {
         try {
             messageIdFactory.fromString((String) messageId);
         } catch (Exception e) {
-            LOG.error("Invalid messageId: " + messageId);
+            LOG.error("Invalid messageId: " + messageId, e);
             return false;
         }
         return true;

http://git-wip-us.apache.org/repos/asf/james-project/blob/fb09b562/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 4556ea2..c1ebb81 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
@@ -501,7 +501,7 @@ public abstract class AbstractConfigurableAsyncServer extends AbstractAsyncServe
         try {
             bind();
         } catch (Exception e) {
-            logger.error("Unable to start server");
+            logger.error("Unable to start server", e);
             return false;
         }
         return true;


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