diff --git a/distribution/src/config/log4j2.properties b/distribution/src/config/log4j2.properties index 0e834735e9761..926d206664855 100644 --- a/distribution/src/config/log4j2.properties +++ b/distribution/src/config/log4j2.properties @@ -63,7 +63,7 @@ appender.deprecation_rolling.name = deprecation_rolling appender.deprecation_rolling.fileName = ${sys:es.logs.base_path}${sys:file.separator}${sys:es.logs.cluster_name}_deprecation.json appender.deprecation_rolling.layout.type = ESJsonLayout appender.deprecation_rolling.layout.type_name = deprecation.elasticsearch -appender.deprecation_rolling.layout.esmessagefields=x-opaque-id,key +appender.deprecation_rolling.layout.esmessagefields=x-opaque-id,key,category appender.deprecation_rolling.filter.rate_limit.type = RateLimitingFilter appender.deprecation_rolling.filePattern = ${sys:es.logs.base_path}${sys:file.separator}${sys:es.logs.cluster_name}_deprecation-%i.json.gz diff --git a/qa/logging-config/src/test/java/org/elasticsearch/common/logging/JsonLoggerTests.java b/qa/logging-config/src/test/java/org/elasticsearch/common/logging/JsonLoggerTests.java index 3f5f00c267a83..3417b06d8b918 100644 --- a/qa/logging-config/src/test/java/org/elasticsearch/common/logging/JsonLoggerTests.java +++ b/qa/logging-config/src/test/java/org/elasticsearch/common/logging/JsonLoggerTests.java @@ -150,6 +150,7 @@ public void testParseFieldEmittingDeprecatedLogs() throws Exception { allOf( hasEntry("type", "deprecation.elasticsearch"), hasEntry("level", "CRITICAL"), + hasEntry("category", "api"), hasEntry("component", "o.e.d.x.ParseField"), hasEntry("cluster.name", "elasticsearch"), hasEntry("node.name", "sample-name"), @@ -161,6 +162,7 @@ public void testParseFieldEmittingDeprecatedLogs() throws Exception { allOf( hasEntry("type", "deprecation.elasticsearch"), hasEntry("level", "CRITICAL"), + hasEntry("category", "api"), hasEntry("component", "o.e.d.x.ParseField"), hasEntry("cluster.name", "elasticsearch"), hasEntry("node.name", "sample-name"), @@ -200,6 +202,7 @@ public void testDeprecatedMessage() throws Exception { allOf( hasEntry("type", "deprecation.elasticsearch"), hasEntry("level", "CRITICAL"), + hasEntry("category", "other"), hasEntry("component", "o.e.d.test"), hasEntry("cluster.name", "elasticsearch"), hasEntry("node.name", "sample-name"), @@ -347,6 +350,7 @@ public void testDuplicateLogMessages() throws Exception { allOf( hasEntry("type", "deprecation.elasticsearch"), hasEntry("level", "CRITICAL"), + hasEntry("category", "other"), hasEntry("component", "o.e.d.test"), hasEntry("cluster.name", "elasticsearch"), hasEntry("node.name", "sample-name"), @@ -381,6 +385,7 @@ public void testDuplicateLogMessages() throws Exception { allOf( hasEntry("type", "deprecation.elasticsearch"), hasEntry("level", "CRITICAL"), + hasEntry("category", "other"), hasEntry("component", "o.e.d.test"), hasEntry("cluster.name", "elasticsearch"), hasEntry("node.name", "sample-name"), @@ -390,6 +395,7 @@ public void testDuplicateLogMessages() throws Exception { allOf( hasEntry("type", "deprecation.elasticsearch"), hasEntry("level", "CRITICAL"), + hasEntry("category", "other"), hasEntry("component", "o.e.d.test"), hasEntry("cluster.name", "elasticsearch"), hasEntry("node.name", "sample-name"), diff --git a/qa/logging-config/src/test/resources/org/elasticsearch/common/logging/json_layout/log4j2.properties b/qa/logging-config/src/test/resources/org/elasticsearch/common/logging/json_layout/log4j2.properties index 91395921ceccc..ce639619e56ca 100644 --- a/qa/logging-config/src/test/resources/org/elasticsearch/common/logging/json_layout/log4j2.properties +++ b/qa/logging-config/src/test/resources/org/elasticsearch/common/logging/json_layout/log4j2.properties @@ -14,7 +14,7 @@ appender.deprecated.name = deprecated appender.deprecated.fileName = ${sys:es.logs.base_path}${sys:file.separator}${sys:es.logs.cluster_name}_deprecated.json appender.deprecated.layout.type = ESJsonLayout appender.deprecated.layout.type_name = deprecation.elasticsearch -appender.deprecated.layout.esmessagefields = x-opaque-id,key +appender.deprecated.layout.esmessagefields = x-opaque-id,key,category appender.deprecated.filter.rate_limit.type = RateLimitingFilter appender.deprecation_rolling_old.type = File @@ -28,7 +28,7 @@ appender.deprecatedconsole.type = Console appender.deprecatedconsole.name = deprecatedconsole appender.deprecatedconsole.layout.type = ESJsonLayout appender.deprecatedconsole.layout.type_name = deprecation.elasticsearch -appender.deprecatedconsole.layout.esmessagefields = x-opaque-id,key +appender.deprecatedconsole.layout.esmessagefields = x-opaque-id,key,category appender.deprecatedconsole.filter.rate_limit.type = RateLimitingFilter appender.index_search_slowlog_rolling.type = File