From a1ed7dacd9bd14b4bd8fb2db0cf828cac6c1df95 Mon Sep 17 00:00:00 2001 From: Iain Sproat <68657+iainsproat@users.noreply.github.com> Date: Thu, 10 Oct 2024 10:24:07 +0100 Subject: [PATCH] fix(logging): /metrics, /readiness, /liveness logged as debug (#3156) --- packages/server/logging/expressLogging.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/server/logging/expressLogging.ts b/packages/server/logging/expressLogging.ts index 0f3237bcc..4a46e7db4 100644 --- a/packages/server/logging/expressLogging.ts +++ b/packages/server/logging/expressLogging.ts @@ -56,8 +56,8 @@ export const LoggingExpressMiddleware = HttpLogger({ genReqId: GenerateRequestId, customLogLevel: (req, res, err) => { const path = getRequestPath(req) - const shouldBeDebug = - ['/metrics', '/readiness', '/liveness'].includes(path || '') ?? false + const shouldBeDebug = ['/metrics', '/readiness', '/liveness'].includes(path || '') + if (shouldBeDebug) return 'debug' if (res.statusCode >= 400 && res.statusCode < 500) { return 'info' @@ -67,7 +67,7 @@ export const LoggingExpressMiddleware = HttpLogger({ return 'info' } - return shouldBeDebug ? 'debug' : 'info' + return 'info' }, customReceivedMessage() {