From b544f588a6f4cc400cdc3ccf58d2ee31fef72021 Mon Sep 17 00:00:00 2001 From: joseph le Date: Fri, 29 Sep 2023 11:29:44 +0700 Subject: [PATCH] add middleware writeLog --- app/utils/Logger.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/app/utils/Logger.ts b/app/utils/Logger.ts index 0aadc88..fe756b2 100644 --- a/app/utils/Logger.ts +++ b/app/utils/Logger.ts @@ -46,13 +46,13 @@ export function loggerAPI(request, response, location) { location + "\n------PAYLOAD------\n" + JSON.stringify(request.all(), null, 2) + - "\n-------DATA--------\n" + - JSON.stringify(body, null, 2) + - "\n-------HEADERS--------\n" + - JSON.stringify(request.headers(), null, 2) + - "\n-------PARAMS--------\n" + + "\n------PARAMS-------\n" + JSON.stringify(request.params(), null, 2) + - "\n\n======================================================================\n======================================================================"; + "\n-----RESPONSE------\n" + + JSON.stringify(body, null, 2) + + "\n------HEADERS------\n" + + JSON.stringify(request.headers(), null, 2) + + "\n\n======================================================================"; fs.exists(fileName, async (exists) => { if (exists) {