]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-14455 Turn-off Elasticsearch 7.10.2 deprecation logging
authorJacek <jacek.poreda@sonarsource.com>
Fri, 12 Feb 2021 16:45:12 +0000 (17:45 +0100)
committersonartech <sonartech@sonarsource.com>
Fri, 12 Feb 2021 20:07:13 +0000 (20:07 +0000)
server/sonar-main/src/main/java/org/sonar/application/es/EsLogging.java
server/sonar-main/src/test/java/org/sonar/application/es/EsLoggingTest.java
server/sonar-server-common/src/main/java/org/sonar/server/log/ServerProcessLogging.java

index 1b0902a6a70cc75230acc6d670a59833f06d9d43..47c8a675a9918e8227666ed13c15e547ff355071 100644 (file)
@@ -47,6 +47,10 @@ public class EsLogging {
     log4JPropertiesBuilder.apply(
       LogLevelConfig.newBuilder(log4JPropertiesBuilder.getRootLoggerName())
         .rootLevelFor(ProcessId.ELASTICSEARCH)
+        // turn off ES type deprecation logging to not flood logs
+        .immutableLevel("DEPRECATION", Level.ERROR)
+        .immutableLevel("org.elasticsearch.deprecation", Level.ERROR)
+        .immutableLevel("org.elasticsearch.client.RestClient", Level.ERROR)
         .build());
 
     return log4JPropertiesBuilder.get();
index 6d92faf980ef6f80e91e661ca2144f7b5502ad76..f62d65b37666f17563067ac532db28c2997e2ae8 100644 (file)
@@ -35,7 +35,7 @@ public class EsLoggingTest {
   @Rule
   public TemporaryFolder temporaryFolder = new TemporaryFolder();
 
-  private EsLogging underTest = new EsLogging();
+  private final EsLogging underTest = new EsLogging();
 
   @Test
   public void createProperties_with_empty_props() throws IOException {
@@ -64,7 +64,16 @@ public class EsLoggingTest {
       "appender.file_es.strategy.action.condition.nested_condition.type", "IfAccumulatedFileCount",
       "appender.file_es.strategy.action.condition.nested_condition.exceeds", "7",
       "rootLogger.level", "INFO",
-      "rootLogger.appenderRef.file_es.ref", "file_es");
+      "rootLogger.appenderRef.file_es.ref", "file_es",
+      "loggers", "DEPRECATION,org.elasticsearch.client.RestClient,org.elasticsearch.deprecation",
+      "logger.org.elasticsearch.client.RestClient.name", "org.elasticsearch.client.RestClient",
+      "logger.org.elasticsearch.deprecation.level", "ERROR",
+      "logger.org.elasticsearch.deprecation.name", "org.elasticsearch.deprecation",
+      "logger.DEPRECATION.level", "ERROR",
+      "logger.DEPRECATION.name", "DEPRECATION",
+      "logger.org.elasticsearch.client.RestClient.level", "ERROR"
+
+    );
   }
 
   @Test
index 7eb374b344bc6fdd95f993a15afff7392a2a5dfc..d2d82065df075224324237e0641cdb1ea5fecca1 100644 (file)
@@ -77,6 +77,7 @@ public abstract class ServerProcessLogging {
     builder.immutableLevel("org.elasticsearch.http", Level.INFO);
 
     // turn off ES type deprecation logging to not flood logs
+    builder.immutableLevel("DEPRECATION", Level.ERROR);
     builder.immutableLevel("org.elasticsearch.deprecation", Level.ERROR);
     builder.immutableLevel("org.elasticsearch.client.RestClient", Level.ERROR);