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