diff options
Diffstat (limited to 'server/sonar-process')
-rw-r--r-- | server/sonar-process/src/main/java/org/sonar/process/LogbackHelper.java | 4 | ||||
-rw-r--r-- | server/sonar-process/src/test/java/org/sonar/process/LogbackHelperTest.java | 4 |
2 files changed, 3 insertions, 5 deletions
diff --git a/server/sonar-process/src/main/java/org/sonar/process/LogbackHelper.java b/server/sonar-process/src/main/java/org/sonar/process/LogbackHelper.java index 0d5d3551872..5ff5e9b4560 100644 --- a/server/sonar-process/src/main/java/org/sonar/process/LogbackHelper.java +++ b/server/sonar-process/src/main/java/org/sonar/process/LogbackHelper.java @@ -90,8 +90,8 @@ public class LogbackHelper { return consoleAppender; } - public Logger configureLogger(LoggerContext loggerContext, String loggerName, Level level) { - Logger logger = loggerContext.getLogger(loggerName); + public Logger configureLogger(String loggerName, Level level) { + Logger logger = getRootContext().getLogger(loggerName); logger.setLevel(level); return logger; } diff --git a/server/sonar-process/src/test/java/org/sonar/process/LogbackHelperTest.java b/server/sonar-process/src/test/java/org/sonar/process/LogbackHelperTest.java index 1cd17d936bf..cf710dcb06e 100644 --- a/server/sonar-process/src/test/java/org/sonar/process/LogbackHelperTest.java +++ b/server/sonar-process/src/test/java/org/sonar/process/LogbackHelperTest.java @@ -102,9 +102,7 @@ public class LogbackHelperTest { @Test public void configureLogger() { - LoggerContext ctx = underTest.getRootContext(); - - Logger logger = underTest.configureLogger(ctx, "my_logger", Level.WARN); + Logger logger = underTest.configureLogger("my_logger", Level.WARN); assertThat(logger.getLevel()).isEqualTo(Level.WARN); assertThat(logger.getName()).isEqualTo("my_logger"); |