From bddb56f41ff4cd08adc6d517777530f090cde49c Mon Sep 17 00:00:00 2001 From: joseph le Date: Fri, 29 Sep 2023 15:11:15 +0700 Subject: [PATCH] add middleware writeLog --- app/utils/Logger.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/utils/Logger.ts b/app/utils/Logger.ts index fe756b2..262b0dc 100644 --- a/app/utils/Logger.ts +++ b/app/utils/Logger.ts @@ -30,7 +30,8 @@ const shortenStringsInObject = (obj, maxLength) => { export function loggerAPI(request, response, location) { let old_data = ""; - let body = shortenStringsInObject(response.getBody(), 300) + let resBody = response.getBody() + let body = shortenStringsInObject(resBody, 300) try { const fileName = "./app/store/logsAPI/" +