From c9986bbc4c47c2cc077fa3ad28615d6a2a963563 Mon Sep 17 00:00:00 2001 From: Miodec Date: Thu, 17 Jul 2025 09:19:39 +0200 Subject: [PATCH] chore: slice long messages --- backend/src/dal/logs.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/backend/src/dal/logs.ts b/backend/src/dal/logs.ts index 052701cf2..26d39196a 100644 --- a/backend/src/dal/logs.ts +++ b/backend/src/dal/logs.ts @@ -32,7 +32,13 @@ async function insertIntoDb( if (!important) delete dbLog.important; - Logger.info(`${event}\t${uid}\t${JSON.stringify(message)}`); + const stringified = JSON.stringify(message); + + Logger.info( + `${event}\t${uid}\t${ + stringified.length > 100 ? stringified.slice(0, 100) + "..." : stringified + }` + ); await getLogsCollection().insertOne(dbLog); }