aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-process
diff options
context:
space:
mode:
authorSimon Brandhof <simon.brandhof@sonarsource.com>2014-07-30 18:04:58 +0200
committerSimon Brandhof <simon.brandhof@sonarsource.com>2014-07-30 18:04:58 +0200
commit1be85fe80d23502a0cc0f61a6d53b50dc32c0ceb (patch)
tree4862e5564f23e9542c68dadbad1b167bfb1ff7e1 /server/sonar-process
parent019079b710f70ce19a449c0d6d209ecc2569a00a (diff)
downloadsonarqube-1be85fe80d23502a0cc0f61a6d53b50dc32c0ceb.tar.gz
sonarqube-1be85fe80d23502a0cc0f61a6d53b50dc32c0ceb.zip
SONAR-4898 fix logs
Diffstat (limited to 'server/sonar-process')
-rw-r--r--server/sonar-process/src/main/java/org/sonar/process/ProcessWrapper.java7
1 files changed, 4 insertions, 3 deletions
diff --git a/server/sonar-process/src/main/java/org/sonar/process/ProcessWrapper.java b/server/sonar-process/src/main/java/org/sonar/process/ProcessWrapper.java
index 9529a799898..5639df18a9d 100644
--- a/server/sonar-process/src/main/java/org/sonar/process/ProcessWrapper.java
+++ b/server/sonar-process/src/main/java/org/sonar/process/ProcessWrapper.java
@@ -146,7 +146,7 @@ public class ProcessWrapper extends Thread implements Terminable {
processBuilder.environment().putAll(envProperties);
try {
- LOGGER.info("Starting {} process with command line: {}", getName(), StringUtils.join(command, " "));
+ LOGGER.info("starting {}: {}", getName(), StringUtils.join(command, " "));
process = processBuilder.start();
errorGobbler = new StreamGobbler(process.getErrorStream(), this.getName() + "-ERROR");
outputGobbler = new StreamGobbler(process.getInputStream(), this.getName());
@@ -260,6 +260,7 @@ public class ProcessWrapper extends Thread implements Terminable {
@Override
public void terminate() {
if (processMXBean != null && process != null) {
+ LOGGER.info("{} stopping", getName());
// Send the terminate command to process in order to gracefully shutdown.
// Then hardly kill it if it didn't terminate in 30 seconds
ScheduledExecutorService killer = Executors.newScheduledThreadPool(1);
@@ -274,11 +275,11 @@ public class ProcessWrapper extends Thread implements Terminable {
ScheduledFuture killerFuture = killer.schedule(killerTask, 30, TimeUnit.SECONDS);
processMXBean.terminate();
killerFuture.cancel(true);
- LOGGER.info("{} process stopped", getName());
+ LOGGER.info("{} stopped", getName());
} catch (Exception ignored) {
// ignore
- ignored.printStackTrace();
+
} finally {
killer.shutdownNow();
}