diff options
author | Simon Brandhof <simon.brandhof@sonarsource.com> | 2015-10-02 20:41:44 +0200 |
---|---|---|
committer | Simon Brandhof <simon.brandhof@sonarsource.com> | 2015-10-06 15:02:22 +0200 |
commit | 248208188e2da2983dc6c615218a1dc32131ca56 (patch) | |
tree | 4a6de73810061d62071643d509f4f565ed2d6dd2 /server/sonar-process | |
parent | 61388ef867ca83f58636499231105f78e4fbbbcb (diff) | |
download | sonarqube-248208188e2da2983dc6c615218a1dc32131ca56.tar.gz sonarqube-248208188e2da2983dc6c615218a1dc32131ca56.zip |
SONAR-6830 add WS api/system/logs and api/system/change_log_level
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"); |