diff options
author | Simon Brandhof <simon.brandhof@sonarsource.com> | 2014-09-24 18:19:50 +0200 |
---|---|---|
committer | Simon Brandhof <simon.brandhof@sonarsource.com> | 2014-09-24 18:19:50 +0200 |
commit | 85c037c87a728edbefc0fd417d6cb89cab246e44 (patch) | |
tree | e3522ce24ff20fe3d3d0647bee363dd74e28fdf1 /sonar-core | |
parent | 410c98978ca7ee3c667dcbcffe4d3ec085c6e517 (diff) | |
download | sonarqube-85c037c87a728edbefc0fd417d6cb89cab246e44.tar.gz sonarqube-85c037c87a728edbefc0fd417d6cb89cab246e44.zip |
SONAR-5621 Merge server log files into a single one
Diffstat (limited to 'sonar-core')
-rw-r--r-- | sonar-core/src/main/java/org/sonar/core/config/Logback.java | 26 |
1 files changed, 0 insertions, 26 deletions
diff --git a/sonar-core/src/main/java/org/sonar/core/config/Logback.java b/sonar-core/src/main/java/org/sonar/core/config/Logback.java index 9d2eb8332bb..ac9a7b4e00c 100644 --- a/sonar-core/src/main/java/org/sonar/core/config/Logback.java +++ b/sonar-core/src/main/java/org/sonar/core/config/Logback.java @@ -20,13 +20,8 @@ package org.sonar.core.config; import ch.qos.logback.classic.Level; -import ch.qos.logback.classic.Logger; import ch.qos.logback.classic.LoggerContext; -import ch.qos.logback.classic.encoder.PatternLayoutEncoder; import ch.qos.logback.classic.joran.JoranConfigurator; -import ch.qos.logback.classic.spi.ILoggingEvent; -import ch.qos.logback.core.Appender; -import ch.qos.logback.core.ConsoleAppender; import ch.qos.logback.core.joran.spi.JoranException; import ch.qos.logback.core.util.StatusPrinter; import org.apache.commons.io.FileUtils; @@ -74,11 +69,6 @@ public class Logback implements BatchComponent, ServerComponent { JoranConfigurator configurator = new JoranConfigurator(); configurator.setContext(configureContext(lc, substitutionVariables)); configurator.doConfigure(input); - if (isConsoleEnabled(substitutionVariables)) { - Logger rootLogger = (Logger) LoggerFactory.getLogger(Logger.ROOT_LOGGER_NAME); - rootLogger.setAdditive(false); - rootLogger.addAppender(consoleAppender(lc, substitutionVariables)); - } } catch (JoranException e) { // StatusPrinter will handle this } finally { @@ -95,22 +85,6 @@ public class Logback implements BatchComponent, ServerComponent { return context; } - private static Boolean isConsoleEnabled(Map<String, String> substitutionVariables) { - return Boolean.valueOf(substitutionVariables.get("CONSOLE_ENABLED")); - } - - private static Appender<ILoggingEvent> consoleAppender(LoggerContext context, Map<String, String> substitutionVariables) { - PatternLayoutEncoder encoder = new PatternLayoutEncoder(); - encoder.setPattern(substitutionVariables.get("CONSOLE_LOGGING_FORMAT")); - encoder.setContext(context); - encoder.start(); - ConsoleAppender<ILoggingEvent> console = new ConsoleAppender<ILoggingEvent>(); - console.setEncoder(encoder); - console.setContext(context); - console.start(); - return console; - } - public void setLoggerLevel(String loggerName, Level level) { ((ch.qos.logback.classic.Logger) LoggerFactory.getLogger(loggerName)).setLevel(level); } |