From 410c98978ca7ee3c667dcbcffe4d3ec085c6e517 Mon Sep 17 00:00:00 2001 From: Simon Brandhof Date: Wed, 24 Sep 2014 14:35:43 +0200 Subject: SONAR-5621 merge log files --- .../src/main/java/org/sonar/application/App.java | 6 +++++- .../resources/org/sonar/application/logback.xml | 23 ++++++++++++++++++++-- 2 files changed, 26 insertions(+), 3 deletions(-) (limited to 'sonar-application/src/main') diff --git a/sonar-application/src/main/java/org/sonar/application/App.java b/sonar-application/src/main/java/org/sonar/application/App.java index bba2dd73069..502cf561394 100644 --- a/sonar-application/src/main/java/org/sonar/application/App.java +++ b/sonar-application/src/main/java/org/sonar/application/App.java @@ -109,7 +109,11 @@ public class App implements Stoppable { CommandLineParser cli = new CommandLineParser(); Properties rawProperties = cli.parseArguments(args); Props props = new PropsBuilder(rawProperties, new JdbcSettings()).build(); - new ProcessLogging().configure(props, "/org/sonar/application/logback.xml"); + ProcessLogging logging = new ProcessLogging(); + logging.configure(props, "/org/sonar/application/logback.xml"); + if (props.valueAsBoolean("sonar.log.console", false)) { + logging.addConsoleAppender(); + } App app = new App(); app.start(props); diff --git a/sonar-application/src/main/resources/org/sonar/application/logback.xml b/sonar-application/src/main/resources/org/sonar/application/logback.xml index 246afdf89f3..e34156819f0 100644 --- a/sonar-application/src/main/resources/org/sonar/application/logback.xml +++ b/sonar-application/src/main/resources/org/sonar/application/logback.xml @@ -3,17 +3,36 @@ + + ${sonar.path.logs}/sonar.log + + + + + + + + + + %3.3logger %msg%n + + + - %d{yyyy.MM.dd HH:mm:ss} %-5level %msg%n + app %d{yyyy.MM.dd HH:mm:ss} %-5level [%logger{20}] %msg%n + + + + - + -- cgit v1.2.3