From 85c037c87a728edbefc0fd417d6cb89cab246e44 Mon Sep 17 00:00:00 2001 From: Simon Brandhof Date: Wed, 24 Sep 2014 18:19:50 +0200 Subject: SONAR-5621 Merge server log files into a single one --- .../main/java/org/sonar/core/config/Logback.java | 26 ---------------------- 1 file changed, 26 deletions(-) (limited to 'sonar-core') 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 substitutionVariables) { - return Boolean.valueOf(substitutionVariables.get("CONSOLE_ENABLED")); - } - - private static Appender consoleAppender(LoggerContext context, Map substitutionVariables) { - PatternLayoutEncoder encoder = new PatternLayoutEncoder(); - encoder.setPattern(substitutionVariables.get("CONSOLE_LOGGING_FORMAT")); - encoder.setContext(context); - encoder.start(); - ConsoleAppender console = new ConsoleAppender(); - 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); } -- cgit v1.2.3