code: public static void copyOutput (Logger target, String name, Process process)
      {
          new StreamReader(target, name + " stdout", process.getInputStream()).start();
          new StreamReader(target, name + " stderr", process.getErrorStream()).start();
      }
docs: Starts threads that copy the output of the supplied process's stdout and stderr streams to
  the supplied target logger. When the streams reach EOF, the threads will exit. The threads
  will be set to daemon so that they do not prevent the VM from exiting.
  
  @param target the logger to which to copy the output.
  @param name prepended to all output lines as either <code>name stderr:</code> or <code>name
  stdout:</code>.
  @param process the process whose output should be copied.