aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-application
diff options
context:
space:
mode:
authorStephane Gamard <stephane.gamard@searchbox.com>2014-07-28 10:46:20 +0200
committerStephane Gamard <stephane.gamard@searchbox.com>2014-07-28 10:46:20 +0200
commit0f9d1f97155997b814a90dbb3914935ab4590f76 (patch)
tree7f518d6e28479f054a3cfbdd6230e382f1234d13 /sonar-application
parentc799e9745bb3f33e7146b870853ede4eb05a8a1f (diff)
downloadsonarqube-0f9d1f97155997b814a90dbb3914935ab4590f76.tar.gz
sonarqube-0f9d1f97155997b814a90dbb3914935ab4590f76.zip
SONAR-4898 - Fixed logger levels and messages
Diffstat (limited to 'sonar-application')
-rw-r--r--sonar-application/src/main/java/org/sonar/application/App.java20
-rw-r--r--sonar-application/src/main/resources/org/sonar/application/logback.xml9
2 files changed, 21 insertions, 8 deletions
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 9be3956c795..fc68b9d5e09 100644
--- a/sonar-application/src/main/java/org/sonar/application/App.java
+++ b/sonar-application/src/main/java/org/sonar/application/App.java
@@ -36,6 +36,10 @@ public class App implements ProcessMXBean {
static final String PROCESS_NAME = "SonarQube";
+ static final String SONAR_WEB_PROCESS = "web";
+ static final String SONAR_SEARCH_PROCESS = "search";
+
+
private final Installation installation;
private Monitor monitor;
private ProcessWrapper elasticsearch;
@@ -69,10 +73,9 @@ public class App implements ProcessMXBean {
}
public void start() {
- Logger logger = LoggerFactory.getLogger(getClass());
- logger.info("Starting Elasticsearch");
- elasticsearch = new ProcessWrapper("ES")
+ LOGGER.info("Starting search server");
+ elasticsearch = new ProcessWrapper(SONAR_SEARCH_PROCESS)
.setWorkDir(installation.homeDir())
.setJmxPort(Integer.parseInt(installation.prop(DefaultSettings.ES_JMX_PORT_KEY)))
.addJavaOpts(installation.prop(DefaultSettings.ES_JAVA_OPTS_KEY))
@@ -84,9 +87,10 @@ public class App implements ProcessMXBean {
.addClasspath(installation.starPath("lib/search"))
.execute();
monitor.registerProcess(elasticsearch);
+ LOGGER.info("Search server is ready");
- logger.info("Starting HTTP server");
- server = new ProcessWrapper("SQ")
+ LOGGER.info("Starting web server");
+ server = new ProcessWrapper(SONAR_WEB_PROCESS)
.setWorkDir(installation.homeDir())
.setJmxPort(Integer.parseInt(installation.prop(DefaultSettings.WEB_JMX_PORT_KEY)))
.addJavaOpts(installation.prop(DefaultSettings.WEB_JAVA_OPTS_KEY))
@@ -103,7 +107,8 @@ public class App implements ProcessMXBean {
.addClasspath(installation.starPath("lib/server"))
.execute();
monitor.registerProcess(server);
- logger.info("HTTP server is Ready");
+ LOGGER.info("Web server is ready");
+
monitor.start();
try {
@@ -120,8 +125,6 @@ public class App implements ProcessMXBean {
@Override
public void terminate() {
if (monitor != null) {
- Logger logger = LoggerFactory.getLogger(getClass());
- logger.info("Shutting down server");
monitor.interrupt();
monitor = null;
if (elasticsearch != null) {
@@ -130,6 +133,7 @@ public class App implements ProcessMXBean {
if (server != null) {
server.terminate();
}
+ LOGGER.info("Stopping SonarQube main process");
}
}
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 1dc3bd67875..23f2333d19c 100644
--- a/sonar-application/src/main/resources/org/sonar/application/logback.xml
+++ b/sonar-application/src/main/resources/org/sonar/application/logback.xml
@@ -36,6 +36,14 @@
</appender>
+ <appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
+ <encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
+ <pattern>
+ %d{yyyy.MM.dd HH:mm:ss} %-5level %msg%n
+ </pattern>
+ </encoder>
+ </appender>
+
<logger name="console" additivity="false">
<appender-ref ref="CONSOLE"/>
</logger>
@@ -51,6 +59,7 @@
<root>
<level value="INFO"/>
<appender-ref ref="CONSOLE"/>
+ <appender-ref ref="FILE"/>
</root>
</configuration>