From 3fc13317a29db3b71e999bace2cc01fd3d876737 Mon Sep 17 00:00:00 2001 From: Zaid Abdulla Date: Sat, 16 Sep 2017 22:36:42 -0700 Subject: [PATCH] Include PID in exception logs --- lib/cluster.js | 3 ++- lib/server.coffee | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/cluster.js b/lib/cluster.js index b5e7e8a..4f83ba2 100644 --- a/lib/cluster.js +++ b/lib/cluster.js @@ -131,7 +131,8 @@ function start(service) { process.on("uncaughtException", function(err) { logger.error({ message: "Uncaught exception in master process, exiting", - exception: err + exception: err, + pid: process.pid }); cluster.removeListener("exit", restartWorker); for (let pid in cluster.workers) diff --git a/lib/server.coffee b/lib/server.coffee index 5b8ba11..535e157 100644 --- a/lib/server.coffee +++ b/lib/server.coffee @@ -66,7 +66,8 @@ exit = () -> process.on('uncaughtException', (err) -> logger.error({ message: 'Uncaught exception' - exception: err + exception: err, + pid: process.pid }) exit() )