Fix request logger throwing errors when logging non-json data
This commit is contained in:
parent
dea27097b3
commit
7a1301d436
@ -123,16 +123,7 @@ export class AkiHttpListener implements IHttpListener
|
|||||||
|
|
||||||
if (globalThis.G_LOG_REQUESTS)
|
if (globalThis.G_LOG_REQUESTS)
|
||||||
{
|
{
|
||||||
let data: any;
|
const log = new Response(req.method, output);
|
||||||
try
|
|
||||||
{
|
|
||||||
data = this.jsonUtil.deserialize(output);
|
|
||||||
}
|
|
||||||
catch (e)
|
|
||||||
{
|
|
||||||
data = output;
|
|
||||||
}
|
|
||||||
const log = new Response(req.method, data);
|
|
||||||
this.requestsLogger.info(`RESPONSE=${this.jsonUtil.serialize(log)}`);
|
this.requestsLogger.info(`RESPONSE=${this.jsonUtil.serialize(log)}`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user