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.
This commit is contained in:
Alan Woodward 2020-08-27 14:17:59 +01:00 committed by Alan Woodward
parent 4540610b62
commit b6cb590685
1 changed files with 2 additions and 1 deletions

View File

@ -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;
}