joeferner / node-java

Bridge API to connect with existing Java APIs.
MIT License
1.88k stars 283 forks source link

Capturing stdout? #82

Open apowers313 opened 11 years ago

apowers313 commented 11 years ago

Is there any way to capture stdout / stderr from the java process? Or at least kill stdout / stderr so that the java output doesn't conflict with my node.js output?

roryokane commented 10 years ago

I haven’t used node-java yet, but maybe you could disable or redirect sdout and stderr from entirely within Java using the System.setOut and System.setErr methods. You could set the output streams to a stream that goes nowhere, or to one that writes to a file or socket and then have your Node code listen for changes to that file or messages from that socket.