I have redirected console.log() to a file(app_stdout.log) Next I run my program. app_stdout.log file is getting created. But If delete the log file manually when program is running then app_stdout.log file is not getting created again. Why? What Im missing here? is there any way i can catch error from the WriteStream?
var stdout = fs.createWriteStream("app_stdout.log", {flags: 'a'});
process.__defineGetter__('stdout', function () {
return stdout;
});