Skip to content

Commit

Permalink
📈 feat(user-auth-service): Improve logging
Browse files Browse the repository at this point in the history
  • Loading branch information
tiitha authored and W3D3 committed Nov 30, 2023
1 parent ea1306b commit 5c727ca
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/user-auth-service/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 5c727ca

Please sign in to comment.