Navigation Menu

Skip to content

Commit

Permalink
[fix] Restore optional logfile destination functionality.
Browse files Browse the repository at this point in the history
  • Loading branch information
AvianFlu committed Mar 2, 2012
1 parent a0c9ac5 commit 298ec73
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/forever.js
Expand Up @@ -374,9 +374,10 @@ forever.startDaemon = function (script, options, callback) {
options.logFile = forever.logFilePath(options.logFile || options.uid + '.log');
options.pidFile = forever.pidFilePath(options.pidFile || options.uid + '.pid');

var monitor = new forever.Monitor(script, options);
var monitor = new forever.Monitor(script, options),
pid;

var pid = daemon.start(options.logFile);
pid = daemon.start(options.logFile);
daemon.lock(options.pidFile);

// process.on('exit', function () {
Expand Down
6 changes: 6 additions & 0 deletions lib/forever/monitor.js
Expand Up @@ -146,6 +146,12 @@ Monitor.prototype.start = function (restart) {
if (!this.silent) {
child.stdout.pipe(process.stdout);
child.stderr.pipe(process.stderr);
if (this.outFile) {
child.stdout.pipe(fs.createWriteStream(this.outFile));
}
if (this.errFile) {
child.stderr.pipe(fs.createWriteStream(this.errFile));
}
}

this.ctime = Date.now();
Expand Down

0 comments on commit 298ec73

Please sign in to comment.