From b39eb09d91f0ea9482d27578faecdf57ed2ea48e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karol=20S=C3=B3jko?= Date: Mon, 13 Nov 2023 11:15:02 +0100 Subject: [PATCH] fix(api-gateway): add request method to the debug logs --- packages/api-gateway/bin/server.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/packages/api-gateway/bin/server.ts b/packages/api-gateway/bin/server.ts index 9ce5eb41e..96b181847 100644 --- a/packages/api-gateway/bin/server.ts +++ b/packages/api-gateway/bin/server.ts @@ -91,11 +91,13 @@ void container.load().then((container) => { server.setErrorConfig((app) => { app.use((error: Record, request: Request, response: Response, _next: NextFunction) => { - logger.error(`[URL: ${request.url}][SNJS: ${request.headers['x-snjs-version']}] Error thrown: ${error.stack}`) + logger.error( + `[URL: |${request.method}| ${request.url}][SNJS: ${request.headers['x-snjs-version']}] Error thrown: ${error.stack}`, + ) logger.debug( - `[URL: ${request.url}][SNJS: ${request.headers['x-snjs-version']}] Request body: ${JSON.stringify( - request.body, - )}`, + `[URL: |${request.method}| ${request.url}][SNJS: ${ + request.headers['x-snjs-version'] + }] Request body: ${JSON.stringify(request.body)}`, ) response.status(500).send({