I'm essentially doing the following:
Process process = new ProcessBuilder().command( ... ).start();
InputStream stdout = process.getInputStream();
LoggerFactory.getLogger( this.class ).debug...?
Is there any way to write the InputStream
to the logger so that it's managed by my logging settings? Or is there another approach I should take to capture the process output?
update: I've rewritten this because I just realized I had read the Process/ProcessBuilder
API wrong and that getInputStream()
is STDOUT
update 2 Ideally the way that this would be achieved would allow me to process both stdout/stderr as they come (line at a time) and not some time later.