From: Simon Brandhof Date: Mon, 22 Sep 2014 09:59:37 +0000 (+0200) Subject: SONAR-4898 add info log X-Git-Tag: 4.5-RC3~15 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=e1414a750b58d34780e944b3af0d67deb854063f;p=sonarqube.git SONAR-4898 add info log --- diff --git a/server/sonar-process/src/main/java/org/sonar/process/ProcessEntryPoint.java b/server/sonar-process/src/main/java/org/sonar/process/ProcessEntryPoint.java index 78d3e280802..5918a2b403f 100644 --- a/server/sonar-process/src/main/java/org/sonar/process/ProcessEntryPoint.java +++ b/server/sonar-process/src/main/java/org/sonar/process/ProcessEntryPoint.java @@ -52,6 +52,10 @@ public class ProcessEntryPoint { return props; } + public String getKey( ){ + return props.nonNullValue(PROPERTY_PROCESS_KEY); + } + /** * Launch process and waits until it's down */ @@ -62,6 +66,7 @@ public class ProcessEntryPoint { monitored = mp; try { + LoggerFactory.getLogger(getClass()).warn("Starting " + getKey()); Runtime.getRuntime().addShutdownHook(shutdownHook); monitored.start(); boolean ready = false; @@ -76,7 +81,7 @@ public class ProcessEntryPoint { monitored.awaitStop(); } } catch (Exception e) { - LoggerFactory.getLogger(getClass()).warn("Fail to start", e); + LoggerFactory.getLogger(getClass()).warn("Fail to start " + getKey(), e); } finally { terminate(); @@ -92,6 +97,7 @@ public class ProcessEntryPoint { */ void terminate() { if (lifecycle.tryToMoveTo(Lifecycle.State.STOPPING)) { + LoggerFactory.getLogger(getClass()).info("Stopping " + getKey()); stopperThread = new StopperThread(monitored, sharedStatus, Long.parseLong(props.nonNullValue(PROPERTY_TERMINATION_TIMEOUT))); stopperThread.start(); }