From 7a1301d43634edb079f2278f783644bd4d797982 Mon Sep 17 00:00:00 2001 From: Dev Date: Wed, 9 Aug 2023 12:16:41 +0100 Subject: [PATCH] Fix request logger throwing errors when logging non-json data --- project/src/servers/http/AkiHttpListener.ts | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/project/src/servers/http/AkiHttpListener.ts b/project/src/servers/http/AkiHttpListener.ts index 013d11ed..000c2030 100644 --- a/project/src/servers/http/AkiHttpListener.ts +++ b/project/src/servers/http/AkiHttpListener.ts @@ -123,16 +123,7 @@ export class AkiHttpListener implements IHttpListener if (globalThis.G_LOG_REQUESTS) { - let data: any; - try - { - data = this.jsonUtil.deserialize(output); - } - catch (e) - { - data = output; - } - const log = new Response(req.method, data); + const log = new Response(req.method, output); this.requestsLogger.info(`RESPONSE=${this.jsonUtil.serialize(log)}`); } }