From aa0249eb282e8aba599720f7a523bcf0b2a56d25 Mon Sep 17 00:00:00 2001 From: joseph le Date: Fri, 29 Sep 2023 11:07:07 +0700 Subject: [PATCH] add middleware writeLog --- app/utils/Logger.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/utils/Logger.ts b/app/utils/Logger.ts index 95426cf..87b9a64 100644 --- a/app/utils/Logger.ts +++ b/app/utils/Logger.ts @@ -16,6 +16,11 @@ const shortenStringsInObject = (obj, maxLength) => { // Rút ngắn chuỗi lại maxLength ký tự obj[key] = obj[key].substring(0, maxLength); } + + if (Array.isArray(obj[key]) && obj[key].length > 20) { + // Rút ngắn chuỗi lại maxLength ký tự + obj[key] = obj[key].slice(0,20) + } } }