From 14ac992ac5383bf7400c98a412cc811f429fb83b Mon Sep 17 00:00:00 2001 From: Tiit Hallas Date: Wed, 29 Nov 2023 10:26:40 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=88=20feat(user-auth-service):=20Impro?= =?UTF-8?q?ve=20logging?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/user-auth-service/app.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/user-auth-service/app.js b/src/user-auth-service/app.js index bc94d641..0e09c161 100644 --- a/src/user-auth-service/app.js +++ b/src/user-auth-service/app.js @@ -45,12 +45,11 @@ logger.token('body', function (req) { }); if (process.env.NODE_ENV !== 'production') { - app.use(logger('[:date[iso]] :status :userid :req[header] ":method :url HTTP/:http-version" - :body :response-time ms')); - + app.use(logger('[:date[iso]] :remote-addr :userid :req[header] ":method :url HTTP/:http-version" - :body ":user-agent" ":referrer" :status :response-time ms')); // load environment variable from .env; needed for ./utils/database require('dotenv').config() } else { - app.use(logger('[:date[iso]] :status :userid :req[header] ":method :url HTTP/:http-version" - :response-time ms')); + app.use(logger('[:date[iso]] :remote-addr :userid :req[header] ":method :url HTTP/:http-version" - - ":user-agent" ":referrer" :status :response-time ms')); } const tracer = initTracer(process.env.JAEGER_SERVICE_NAME);