Skip to content
This repository has been archived by the owner on Oct 30, 2018. It is now read-only.

Commit

Permalink
pipe stderr to logfile too
Browse files Browse the repository at this point in the history
  • Loading branch information
Gordon Hall committed Jan 11, 2017
1 parent 2a77337 commit 8db24da
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions lib/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,12 +107,13 @@ class RPC {
);
share.readyState = RPC.SHARE_STARTED;

let logFile = fs.createWriteStream(share.config.loggerOutputFile, {
flags: 'a'
});

// NB: Pipe the stdio to the configured log file
share.process.stdout.pipe(
fs.createWriteStream(share.config.loggerOutputFile, {
flags: 'a'
})
);
share.process.stdout.pipe(logFile);
share.process.stderr.pipe(logFile);

// NB: Listen for state changes to update the share's record
share.process.on('error', (err) => {
Expand Down

0 comments on commit 8db24da

Please sign in to comment.