From 578f543c019c1d62fbe1d30fb53e2e2b61b88c67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Garc=C3=ADa=20Aubert?= Date: Thu, 11 Jun 2020 18:21:13 +0200 Subject: [PATCH] log user --- lib/api/middlewares/user.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/api/middlewares/user.js b/lib/api/middlewares/user.js index bf508085..155d3347 100644 --- a/lib/api/middlewares/user.js +++ b/lib/api/middlewares/user.js @@ -6,8 +6,10 @@ module.exports = function user (metadataBackend) { const cdbRequest = new CdbRequest(); return function userMiddleware (req, res, next) { + const { logger } = res.locals; try { res.locals.user = getUserNameFromRequest(req, cdbRequest); + logger.info({ user: res.locals.user }); } catch (err) { return next(err); }