james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From btell...@apache.org
Subject [13/21] james-project git commit: JAMES-2048 Enhance log information when indexing
Date Wed, 07 Jun 2017 10:46:23 GMT
JAMES-2048 Enhance log information when indexing


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

Branch: refs/heads/master
Commit: d4246a01cdf95323192aeaaef529db71286531bd
Parents: 86e0703
Author: quynhn <qnguyen@linagora.com>
Authored: Fri Jun 2 10:13:01 2017 +0700
Committer: benwa <btellier@linagora.com>
Committed: Wed Jun 7 17:35:43 2017 +0700

----------------------------------------------------------------------
 .../ElasticSearchListeningMessageSearchIndex.java | 18 ++++++++++++++++--
 1 file changed, 16 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/james-project/blob/d4246a01/mailbox/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/events/ElasticSearchListeningMessageSearchIndex.java
----------------------------------------------------------------------
diff --git a/mailbox/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/events/ElasticSearchListeningMessageSearchIndex.java
b/mailbox/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/events/ElasticSearchListeningMessageSearchIndex.java
index 55d3f2e..bfd8c1f 100644
--- a/mailbox/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/events/ElasticSearchListeningMessageSearchIndex.java
+++ b/mailbox/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/events/ElasticSearchListeningMessageSearchIndex.java
@@ -109,13 +109,27 @@ public class ElasticSearchListeningMessageSearchIndex extends ListeningMessageSe
     @Override
     public void add(MailboxSession session, Mailbox mailbox, MailboxMessage message) throws
MailboxException {
         try {
+            LOGGER.info("Indexing mailbox {}-{} of user {} on message {}",
+                    mailbox.getName(),
+                    mailbox.getMailboxId(),
+                    session.getUser().getUserName(),
+                    message.getUid());
             indexer.indexMessage(indexIdFor(mailbox, message.getUid()), messageToElasticSearchJson.convertToJson(message,
ImmutableList.of(session.getUser())));
         } catch (Exception e) {
             try {
-                LOGGER.warn("indexing message {} without attachments ", message.getUid());
+                LOGGER.warn("Indexing mailbox {}-{} of user {} on message {} without attachments
",
+                        mailbox.getName(),
+                        mailbox.getMailboxId(),
+                        session.getUser().getUserName(),
+                        message.getUid());
                 indexer.indexMessage(indexIdFor(mailbox, message.getUid()), messageToElasticSearchJson.convertToJsonWithoutAttachment(message,
ImmutableList.of(session.getUser())));
             } catch (JsonProcessingException e1) {
-                LOGGER.error("Error when indexing message " + message.getUid() + " without
its attachment", e1);
+                LOGGER.error("Error when indexing mailbox {}-{} of user {} on message {}
without its attachment",
+                        mailbox.getName(),
+                        mailbox.getMailboxId(),
+                        session.getUser().getUserName(),
+                        message.getUid(),
+                        e1);
             }
         }
     }


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