fix(logger): improve logging and make sure no data is lost

This commit is contained in:
Matteo Pagliazzi
2020-03-24 20:29:31 +01:00
parent 3458d89c1d
commit 2cd0ed5973
5 changed files with 130 additions and 46 deletions

View File

@@ -34,7 +34,7 @@ if (CORES !== 0 && cluster.isMaster && (IS_DEV || IS_PROD)) {
cluster.on('disconnect', worker => {
const w = cluster.fork(); // replace the dead worker
logger.info('[%s] [master:%s] worker:%s disconnect! new worker:%s fork', new Date(), process.pid, worker.process.pid, w.process.pid);
logger.info(`[${new Date()}] [master:${process.pid}] worker:${worker.process.pid} disconnect! new worker:${w.process.pid} fork`);
});
} else {
module.exports = require('./server.js');