diff options
author | Stephane Gamard <stephane.gamard@searchbox.com> | 2014-07-28 10:46:20 +0200 |
---|---|---|
committer | Stephane Gamard <stephane.gamard@searchbox.com> | 2014-07-28 10:46:20 +0200 |
commit | 0f9d1f97155997b814a90dbb3914935ab4590f76 (patch) | |
tree | 7f518d6e28479f054a3cfbdd6230e382f1234d13 /sonar-application/src/main/java/org/sonar | |
parent | c799e9745bb3f33e7146b870853ede4eb05a8a1f (diff) | |
download | sonarqube-0f9d1f97155997b814a90dbb3914935ab4590f76.tar.gz sonarqube-0f9d1f97155997b814a90dbb3914935ab4590f76.zip |
SONAR-4898 - Fixed logger levels and messages
Diffstat (limited to 'sonar-application/src/main/java/org/sonar')
-rw-r--r-- | sonar-application/src/main/java/org/sonar/application/App.java | 20 |
1 files changed, 12 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"); } } |