From 879d4202c79764a5bdbce8577efd2049f2e3af17 Mon Sep 17 00:00:00 2001 From: Simon Brandhof Date: Mon, 2 Oct 2017 22:39:29 +0200 Subject: [PATCH] SONAR-9902 Silence debug logs of PostgreSQL driver --- .../src/main/java/org/sonar/ce/log/CeProcessLogging.java | 2 +- .../main/java/org/sonar/server/app/ServerProcessLogging.java | 5 ++++- .../java/org/sonar/server/app/WebServerProcessLogging.java | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/server/sonar-server/src/main/java/org/sonar/ce/log/CeProcessLogging.java b/server/sonar-server/src/main/java/org/sonar/ce/log/CeProcessLogging.java index bdf681b0c3f..e89eba0f90b 100644 --- a/server/sonar-server/src/main/java/org/sonar/ce/log/CeProcessLogging.java +++ b/server/sonar-server/src/main/java/org/sonar/ce/log/CeProcessLogging.java @@ -41,7 +41,7 @@ public class CeProcessLogging extends ServerProcessLogging { logLevelConfigBuilder.levelByDomain("sql", ProcessId.COMPUTE_ENGINE, LogDomain.SQL); logLevelConfigBuilder.levelByDomain("es", ProcessId.COMPUTE_ENGINE, LogDomain.ES); JMX_RMI_LOGGER_NAMES.forEach(loggerName -> logLevelConfigBuilder.levelByDomain(loggerName, ProcessId.COMPUTE_ENGINE, LogDomain.JMX)); - MSQDRIVER_LOGGER_NAMES_TO_TURN_OFF.forEach(loggerName -> logLevelConfigBuilder.immutableLevel(loggerName, Level.OFF)); + LOGGER_NAMES_TO_TURN_OFF.forEach(loggerName -> logLevelConfigBuilder.immutableLevel(loggerName, Level.OFF)); } @Override diff --git a/server/sonar-server/src/main/java/org/sonar/server/app/ServerProcessLogging.java b/server/sonar-server/src/main/java/org/sonar/server/app/ServerProcessLogging.java index caccee2097a..a91aa4b8cf2 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/app/ServerProcessLogging.java +++ b/server/sonar-server/src/main/java/org/sonar/server/app/ServerProcessLogging.java @@ -47,7 +47,8 @@ public abstract class ServerProcessLogging { "sun.rmi.transport.misc", "sun.rmi.server.call", "sun.rmi.dgc"); - protected static final Set MSQDRIVER_LOGGER_NAMES_TO_TURN_OFF = ImmutableSet.of( + protected static final Set LOGGER_NAMES_TO_TURN_OFF = ImmutableSet.of( + // mssql driver "com.microsoft.sqlserver.jdbc.internals", "com.microsoft.sqlserver.jdbc.ResultSet", "com.microsoft.sqlserver.jdbc.Statement", @@ -78,6 +79,8 @@ public abstract class ServerProcessLogging { builder.immutableLevel("org.apache.coyote", Level.INFO); builder.immutableLevel("org.apache.jasper", Level.INFO); builder.immutableLevel("org.apache.tomcat", Level.INFO); + builder.immutableLevel("org.postgresql.core.v3.QueryExecutorImpl", Level.INFO); + builder.immutableLevel("org.postgresql.jdbc.PgConnection", Level.INFO); extendLogLevelConfiguration(builder); diff --git a/server/sonar-server/src/main/java/org/sonar/server/app/WebServerProcessLogging.java b/server/sonar-server/src/main/java/org/sonar/server/app/WebServerProcessLogging.java index 3ec69e7f9c7..e17ca6e5e71 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/app/WebServerProcessLogging.java +++ b/server/sonar-server/src/main/java/org/sonar/server/app/WebServerProcessLogging.java @@ -46,7 +46,7 @@ public class WebServerProcessLogging extends ServerProcessLogging { logLevelConfigBuilder.offUnlessTrace("org.apache.catalina.core.StandardContext"); logLevelConfigBuilder.offUnlessTrace("org.apache.catalina.core.StandardService"); - MSQDRIVER_LOGGER_NAMES_TO_TURN_OFF.forEach(loggerName -> logLevelConfigBuilder.immutableLevel(loggerName, Level.OFF)); + LOGGER_NAMES_TO_TURN_OFF.forEach(loggerName -> logLevelConfigBuilder.immutableLevel(loggerName, Level.OFF)); } @Override -- 2.39.5