From: Simon Brandhof Date: Thu, 31 Jul 2014 21:33:33 +0000 (+0200) Subject: SONAR-4898 improve System.out/err logging X-Git-Tag: 4.5-RC1~305 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=a4c5e9c14e5e57a0bd3f167891c876a5a6dc5124;p=sonarqube.git SONAR-4898 improve System.out/err logging --- 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 8b678522774..7feda4fdcc5 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 @@ -68,6 +68,7 @@ public class ProcessWrapper extends Thread implements Terminable { } private final static Logger LOGGER = LoggerFactory.getLogger(ProcessWrapper.class); + public static final long READY_TIMEOUT_MS = 120000L; private String processName, className; @@ -322,12 +323,12 @@ public class ProcessWrapper extends Thread implements Terminable { private static class StreamGobbler extends Thread { private final InputStream is; - private final String pName; + private final Logger logger; StreamGobbler(InputStream is, String name) { super(name + "_ProcessStreamGobbler"); this.is = is; - this.pName = name; + this.logger = LoggerFactory.getLogger(name); } @Override @@ -337,9 +338,9 @@ public class ProcessWrapper extends Thread implements Terminable { try { String line; while ((line = br.readLine()) != null) { - LOGGER.info(pName + " > " + line); + logger.info(line); } - } catch (IOException ignored) { + } catch (Exception ignored) { // ignored } finally {