]> source.dussan.org Git - sonarqube.git/commitdiff
Revert "SONAR-4999 Remove duplicate messages from logfile when console is enabled"
authorJean-Baptiste Lievremont <jean-baptiste.lievremont@sonarsource.com>
Fri, 7 Feb 2014 16:10:59 +0000 (17:10 +0100)
committerJean-Baptiste Lievremont <jean-baptiste.lievremont@sonarsource.com>
Fri, 7 Feb 2014 16:10:59 +0000 (17:10 +0100)
This reverts commit b7537d53412142416cfc314d3acf0e2b85dad0fe.

sonar-core/src/main/java/org/sonar/core/config/Logback.java

index 8749749b79b517a3d601c376c9fadc5ce3bb42b5..e9fb414675b0404dfdf2aae29da61722b9acb7b5 100644 (file)
@@ -77,7 +77,6 @@ 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) {
@@ -102,7 +101,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("LOGFILE_LOGGING_FORMAT"));
+    encoder.setPattern(substitutionVariables.get("CONSOLE_LOGGING_FORMAT"));
     encoder.setContext(context);
     encoder.start();
     ConsoleAppender<ILoggingEvent> console = new ConsoleAppender<ILoggingEvent>();