From f5a8c3881f2ab20f6e3627631f7bd2dc4c253d55 Mon Sep 17 00:00:00 2001 From: kimchy Date: Wed, 8 Dec 2010 01:21:21 +0200 Subject: [PATCH] add debug logging on failed bug items executions --- .../elasticsearch/action/bulk/TransportShardBulkAction.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/modules/elasticsearch/src/main/java/org/elasticsearch/action/bulk/TransportShardBulkAction.java b/modules/elasticsearch/src/main/java/org/elasticsearch/action/bulk/TransportShardBulkAction.java index 209a927b629..8cfc1269003 100644 --- a/modules/elasticsearch/src/main/java/org/elasticsearch/action/bulk/TransportShardBulkAction.java +++ b/modules/elasticsearch/src/main/java/org/elasticsearch/action/bulk/TransportShardBulkAction.java @@ -124,6 +124,9 @@ public class TransportShardBulkAction extends TransportShardReplicationOperation ops[i] = indexShard.prepareCreate(sourceToParse); } } catch (Exception e) { + if (logger.isDebugEnabled()) { + logger.debug("[" + shardRequest.request.index() + "][" + shardRequest.shardId + "]" + ": Failed to execute bulk item (index) [" + indexRequest + "]", e); + } responses[i] = new BulkItemResponse(item.id(), indexRequest.opType().toString().toLowerCase(), new BulkItemResponse.Failure(indexRequest.index(), indexRequest.type(), indexRequest.id(), ExceptionsHelper.detailedMessage(e))); } @@ -132,6 +135,9 @@ public class TransportShardBulkAction extends TransportShardReplicationOperation try { ops[i] = indexShard.prepareDelete(deleteRequest.type(), deleteRequest.id()); } catch (Exception e) { + if (logger.isDebugEnabled()) { + logger.debug("[" + shardRequest.request.index() + "][" + shardRequest.shardId + "]" + ": Failed to execute bulk item (delete) [" + deleteRequest + "]", e); + } responses[i] = new BulkItemResponse(item.id(), "delete", new BulkItemResponse.Failure(deleteRequest.index(), deleteRequest.type(), deleteRequest.id(), ExceptionsHelper.detailedMessage(e))); }