Skip to content

Commit c9986bb

Browse files
committed
chore: slice long messages
1 parent b15520f commit c9986bb

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

backend/src/dal/logs.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,13 @@ async function insertIntoDb(
3232

3333
if (!important) delete dbLog.important;
3434

35-
Logger.info(`${event}\t${uid}\t${JSON.stringify(message)}`);
35+
const stringified = JSON.stringify(message);
36+
37+
Logger.info(
38+
`${event}\t${uid}\t${
39+
stringified.length > 100 ? stringified.slice(0, 100) + "..." : stringified
40+
}`
41+
);
3642

3743
await getLogsCollection().insertOne(dbLog);
3844
}

0 commit comments

Comments
 (0)