Finalize request's log

This commit is contained in:
Daniel García Aubert 2020-06-05 20:08:40 +02:00
parent d28744a5e3
commit 02c8e28494

View File

@ -9,6 +9,7 @@ module.exports = function initLogger ({ logger }) {
res.locals.logger.info({ request: req });
res.on('finish', () => res.locals.logger.info({ response: res }));
res.on('close', () => res.locals.logger.info({ end: true }));
next();
};