diff options
author | Jean-Baptiste Lievremont <jean-baptiste.lievremont@sonarsource.com> | 2014-02-07 15:45:58 +0100 |
---|---|---|
committer | Jean-Baptiste Lievremont <jean-baptiste.lievremont@sonarsource.com> | 2014-02-07 15:47:31 +0100 |
commit | b7537d53412142416cfc314d3acf0e2b85dad0fe (patch) | |
tree | 2ebe61863b7b351ed5b3cd765e07a995f7e46012 /sonar-core | |
parent | fee822cbce112c228763ffd96dad02b8317d0624 (diff) | |
download | sonarqube-b7537d53412142416cfc314d3acf0e2b85dad0fe.tar.gz sonarqube-b7537d53412142416cfc314d3acf0e2b85dad0fe.zip |
SONAR-4999 Remove duplicate messages from logfile when console is enabled
Diffstat (limited to 'sonar-core')
-rw-r--r-- | sonar-core/src/main/java/org/sonar/core/config/Logback.java | 3 |
1 files changed, 2 insertions, 1 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 e9fb414675b..8749749b79b 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 @@ -77,6 +77,7 @@ public class Logback implements BatchComponent, ServerComponent { if (isConsoleEnabled(substitutionVariables)) { Logger rootLogger = (Logger) LoggerFactory.getLogger(Logger.ROOT_LOGGER_NAME); rootLogger.setAdditive(false); + rootLogger.detachAppender("LOGFILE"); rootLogger.addAppender(consoleAppender(lc, substitutionVariables)); } } catch (JoranException e) { @@ -101,7 +102,7 @@ public class Logback implements BatchComponent, ServerComponent { private static Appender<ILoggingEvent> consoleAppender(LoggerContext context, Map<String, String> substitutionVariables) { PatternLayoutEncoder encoder = new PatternLayoutEncoder(); - encoder.setPattern(substitutionVariables.get("CONSOLE_LOGGING_FORMAT")); + encoder.setPattern(substitutionVariables.get("LOGFILE_LOGGING_FORMAT")); encoder.setContext(context); encoder.start(); ConsoleAppender<ILoggingEvent> console = new ConsoleAppender<ILoggingEvent>(); |