From a4c5e9c14e5e57a0bd3f167891c876a5a6dc5124 Mon Sep 17 00:00:00 2001 From: Simon Brandhof Date: Thu, 31 Jul 2014 23:33:33 +0200 Subject: [PATCH] SONAR-4898 improve System.out/err logging --- .../src/main/java/org/sonar/process/ProcessWrapper.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 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 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 { -- 2.39.5