JAMES-1804 Add log 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/cacb1469 Tree: http://git-wip-us.apache.org/repos/asf/james-project/tree/cacb1469 Diff: http://git-wip-us.apache.org/repos/asf/james-project/diff/cacb1469 Branch: refs/heads/master Commit: cacb14690f74ec1e83a37c8a5113aa1e36fd3860 Parents: 4d50f3c Author: Antoine Duprat <[email protected]> Authored: Wed Jul 20 14:51:24 2016 +0200 Committer: Antoine Duprat <[email protected]> Committed: Tue Jul 26 08:57:05 2016 +0200 ---------------------------------------------------------------------- .../apache/james/mailbox/elasticsearch/ElasticSearchIndexer.java | 4 ++++ 1 file changed, 4 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/james-project/blob/cacb1469/mailbox/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/ElasticSearchIndexer.java ---------------------------------------------------------------------- diff --git a/mailbox/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/ElasticSearchIndexer.java b/mailbox/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/ElasticSearchIndexer.java index 85c46bc..523fa22 100644 --- a/mailbox/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/ElasticSearchIndexer.java +++ b/mailbox/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/ElasticSearchIndexer.java @@ -28,6 +28,8 @@ import org.elasticsearch.action.index.IndexResponse; import org.elasticsearch.client.Client; import org.elasticsearch.common.Strings; import org.elasticsearch.index.query.QueryBuilder; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import com.google.common.base.Preconditions; @@ -53,6 +55,7 @@ public class ElasticSearchIndexer { } } + private static final Logger LOGGER = LoggerFactory.getLogger(ElasticSearchIndexer.class); public static final String MAILBOX_INDEX = "mailbox"; public static final String MESSAGE_TYPE = "message"; @@ -67,6 +70,7 @@ public class ElasticSearchIndexer { public IndexResponse indexMessage(String id, String content) { checkArgument(content); + LOGGER.debug(String.format("Indexing %s: %s", id, content)); return client.prepareIndex(MAILBOX_INDEX, MESSAGE_TYPE, id) .setSource(content) .get(); --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
