Skip to content

Commit

Permalink
Add immortal flag and flush all log before exit.
Browse files Browse the repository at this point in the history
  • Loading branch information
llun committed Oct 26, 2012
1 parent be70322 commit c9b8434
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/crossweb.js
Expand Up @@ -59,8 +59,13 @@ Crossweb.prototype.run = function () {
// After node Domain exit experimental, will move to node.js Domain
process.on('uncaughtException', function (error) {
logger.error('Something wrong and we can\'t handle it.\n%s', util.inspect(error, false, 3));
process.exit(1);
if (!config.immortal) {
log4js.flushAllLoggers(function () {
process.exit(1);
});
}
});

});
});

Expand Down

0 comments on commit c9b8434

Please sign in to comment.