diff --git a/server/src/main/java/org/elasticsearch/action/bulk/TransportBulkAction.java b/server/src/main/java/org/elasticsearch/action/bulk/TransportBulkAction.java index f0fffee8c1ee4..12c65b7d9ae71 100644 --- a/server/src/main/java/org/elasticsearch/action/bulk/TransportBulkAction.java +++ b/server/src/main/java/org/elasticsearch/action/bulk/TransportBulkAction.java @@ -21,7 +21,6 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; -import org.apache.logging.log4j.message.ParameterizedMessage; import org.apache.lucene.util.SparseFixedBitSet; import org.elasticsearch.Assertions; import org.elasticsearch.ElasticsearchParseException; @@ -79,6 +78,7 @@ import java.util.HashSet; import java.util.Iterator; import java.util.List; +import java.util.Locale; import java.util.Map; import java.util.Objects; import java.util.Set; @@ -702,8 +702,6 @@ public boolean isForceExecution() { static final class BulkRequestModifier implements Iterator> { - private static final Logger logger = LogManager.getLogger(BulkRequestModifier.class); - final BulkRequest bulkRequest; final SparseFixedBitSet failedSlots; final List itemResponses; @@ -784,7 +782,7 @@ synchronized void markItemAsDropped(int slot) { synchronized void markItemAsFailed(int slot, Exception e) { IndexRequest indexRequest = getIndexWriteRequest(bulkRequest.requests().get(slot)); - logger.debug(() -> new ParameterizedMessage("failed to execute pipeline [{}] for document [{}/{}/{}]", + logger.debug(String.format(Locale.ROOT, "failed to execute pipeline [%s] for document [%s/%s/%s]", indexRequest.getPipeline(), indexRequest.index(), indexRequest.type(), indexRequest.id()), e); // We hit a error during preprocessing a request, so we: diff --git a/server/src/main/java/org/elasticsearch/ingest/IngestService.java b/server/src/main/java/org/elasticsearch/ingest/IngestService.java index 21821ef40ff0b..9bf1eba8dc0ed 100644 --- a/server/src/main/java/org/elasticsearch/ingest/IngestService.java +++ b/server/src/main/java/org/elasticsearch/ingest/IngestService.java @@ -21,6 +21,7 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; +import org.apache.logging.log4j.message.ParameterizedMessage; import org.elasticsearch.ElasticsearchParseException; import org.elasticsearch.ExceptionsHelper; import org.elasticsearch.ResourceNotFoundException; @@ -528,6 +529,8 @@ private void executePipelines( String originalIndex = indexRequest.indices()[0]; innerExecute(slot, indexRequest, pipeline, onDropped, e -> { if (e != null) { + logger.debug(() -> new ParameterizedMessage("failed to execute pipeline [{}] for document [{}/{}]", + pipelineId, indexRequest.index(), indexRequest.id()), e); onFailure.accept(slot, e); } @@ -567,6 +570,8 @@ private void executePipelines( } }); } catch (Exception e) { + logger.debug(() -> new ParameterizedMessage("failed to execute pipeline [{}] for document [{}/{}]", + pipelineId, indexRequest.index(), indexRequest.id()), e); onFailure.accept(slot, e); if (counter.decrementAndGet() == 0) { onCompletion.accept(originalThread, null);