diff options
author | Sébastien Lesaint <sebastien.lesaint@sonarsource.com> | 2016-11-14 16:06:23 +0100 |
---|---|---|
committer | Sébastien Lesaint <sebastien.lesaint@sonarsource.com> | 2016-11-16 10:09:21 +0100 |
commit | 7c6a909d760e457af4259bf49bfbc6e1902d631b (patch) | |
tree | a47402a814b5095d239ba4921b893c5e702d7560 /sonar-application/src/main/java | |
parent | adf8fbe5364084c3da6d004d1ad55cba0620be4d (diff) | |
download | sonarqube-7c6a909d760e457af4259bf49bfbc6e1902d631b.tar.gz sonarqube-7c6a909d760e457af4259bf49bfbc6e1902d631b.zip |
SONAR-8333 restore process name in logs
because when running ITs with option -Dsonar.log.console we can't make a difference between logs from each process anymore
Diffstat (limited to 'sonar-application/src/main/java')
-rw-r--r-- | sonar-application/src/main/java/org/sonar/application/AppLogging.java | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/sonar-application/src/main/java/org/sonar/application/AppLogging.java b/sonar-application/src/main/java/org/sonar/application/AppLogging.java index 12cad324f57..4395f19e7fa 100644 --- a/sonar-application/src/main/java/org/sonar/application/AppLogging.java +++ b/sonar-application/src/main/java/org/sonar/application/AppLogging.java @@ -31,6 +31,8 @@ import org.slf4j.LoggerFactory; import org.sonar.process.LogbackHelper; import org.sonar.process.Props; +import static org.sonar.process.monitor.StreamGobbler.LOGGER_GOBBLER; + /** * Configure logback for the master process */ @@ -38,7 +40,6 @@ class AppLogging { static final String CONSOLE_LOGGER = "console"; static final String CONSOLE_APPENDER = "CONSOLE"; - static final String GOBBLER_LOGGER = "gobbler"; static final String GOBBLER_APPENDER = "GOBBLER"; static final String APP_PATTERN = "%d{yyyy.MM.dd HH:mm:ss} %-5level app[][%logger{20}] %msg%n"; @@ -65,7 +66,7 @@ class AppLogging { Logger consoleLogger = (Logger) LoggerFactory.getLogger(CONSOLE_LOGGER); Appender<ILoggingEvent> consoleAppender = consoleLogger.getAppender(CONSOLE_APPENDER); - Logger gobblerLogger = (Logger) LoggerFactory.getLogger(GOBBLER_LOGGER); + Logger gobblerLogger = (Logger) LoggerFactory.getLogger(LOGGER_GOBBLER); gobblerLogger.addAppender(consoleAppender); } @@ -89,7 +90,7 @@ class AppLogging { fileAppender.start(); // configure logger - Logger gobblerLogger = ctx.getLogger(GOBBLER_LOGGER); + Logger gobblerLogger = ctx.getLogger(LOGGER_GOBBLER); gobblerLogger.setAdditive(false); gobblerLogger.addAppender(fileAppender); } |