From 8dd856987a9368bed52f8edb042ed0673789f639 Mon Sep 17 00:00:00 2001 From: Peter Nied Date: Wed, 21 Feb 2024 00:14:19 +0000 Subject: [PATCH] Switch to deprecation logger so message is only logged once per index Signed-off-by: Peter Nied --- .../java/org/opensearch/index/mapper/MapperService.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/server/src/main/java/org/opensearch/index/mapper/MapperService.java b/server/src/main/java/org/opensearch/index/mapper/MapperService.java index b69c680168969..2db0ab63a51f7 100644 --- a/server/src/main/java/org/opensearch/index/mapper/MapperService.java +++ b/server/src/main/java/org/opensearch/index/mapper/MapperService.java @@ -262,7 +262,12 @@ public MapperService( this.idFieldDataEnabled = idFieldDataEnabled; if (INDEX_MAPPER_DYNAMIC_SETTING.exists(indexSettings.getSettings())) { - logger.warn("Setting {} was removed after version 6.0.0, its value will be ignored.", INDEX_MAPPER_DYNAMIC_SETTING.getKey()); + deprecationLogger.deprecate( + index().getName() + INDEX_MAPPER_DYNAMIC_SETTING.getKey(), + "Index [{}] has setting [{}] that was removed after version ES 6.0.0, its value will be ignored.", + index().getName(), + INDEX_MAPPER_DYNAMIC_SETTING.getKey() + ); } }