Skip to content
Snippets Groups Projects
Commit 3d2ca1fb authored by Lloyd Hilaiel's avatar Lloyd Hilaiel
Browse files

rework uncaught exception handling: log an error, don't bring the process...

rework uncaught exception handling: log an error, don't bring the process down, bump a statsd counter: issue #1558
parent 397dbe65
No related branches found
No related tags found
No related merge requests found
......@@ -40,7 +40,7 @@ exports.logger = new (winston.Logger)({
timestamp: function () { return new Date().toISOString() },
filename: filename,
colorize: true,
handleExceptions: !!process.env['LOG_TO_CONSOLE']
handleExceptions: true
})]
});
......@@ -51,6 +51,6 @@ exports.enableConsoleLogging = function() {
});
};
if (process.env['LOG_TO_CONSOLE']) exports.enableConsoleLogging();
exports.logger.exitOnError = false;
......@@ -29,3 +29,7 @@ if (statsd_config && statsd_config.enabled) {
statsd = new StatsD(options["host"], options["port"]);
}
process.on('uncaughtException', function(err) {
if (statsd) statsd.increment(PREFIX + 'uncaught_exception');
});
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment