From b6cb59068525b3a2aba3c2bd0f97f015a97c5387 Mon Sep 17 00:00:00 2001 From: Alan Woodward Date: Thu, 27 Aug 2020 14:17:59 +0100 Subject: [PATCH] Log more information when mappings fail on index creation (#61577) Errors from bad mappings at index creation are currently logged at DEBUG level, which can make it difficult to work out what's going on if the index is being auto-created. This commit ups the log level to INFO for auto-created indices, and includes some more information in the log message. --- .../cluster/metadata/MetadataCreateIndexService.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/server/src/main/java/org/elasticsearch/cluster/metadata/MetadataCreateIndexService.java b/server/src/main/java/org/elasticsearch/cluster/metadata/MetadataCreateIndexService.java index cec3c79433a..babaf38ba0a 100644 --- a/server/src/main/java/org/elasticsearch/cluster/metadata/MetadataCreateIndexService.java +++ b/server/src/main/java/org/elasticsearch/cluster/metadata/MetadataCreateIndexService.java @@ -392,7 +392,8 @@ public class MetadataCreateIndexService { try { updateIndexMappingsAndBuildSortOrder(indexService, request, mappings, sourceMetadata); } catch (Exception e) { - logger.debug("failed on parsing mappings on index creation [{}]", request.index()); + logger.log(silent ? Level.DEBUG : Level.INFO, + "failed on parsing mappings on index creation [{}]", request.index(), e); throw e; }