From e1414a750b58d34780e944b3af0d67deb854063f Mon Sep 17 00:00:00 2001 From: Simon Brandhof Date: Mon, 22 Sep 2014 11:59:37 +0200 Subject: [PATCH] SONAR-4898 add info log --- .../main/java/org/sonar/process/ProcessEntryPoint.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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(); } -- 2.39.5