From 987c543727dd4d816987148ec3ccdb4337d601ac Mon Sep 17 00:00:00 2001 From: Eric Bailey Date: Thu, 21 Dec 2023 16:43:57 -0600 Subject: [PATCH] Increase log dump to 500, dump everything in there (#2268) --- src/logger/index.ts | 12 +++++++----- src/logger/logDump.ts | 2 +- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/logger/index.ts b/src/logger/index.ts index dd0380f6..d6d8d9fc 100644 --- a/src/logger/index.ts +++ b/src/logger/index.ts @@ -287,15 +287,11 @@ export class Logger { metadata: Metadata = {}, ) { if (!this.enabled) return - if (!enabledLogLevels[this.level].includes(level)) return const timestamp = Date.now() const meta = metadata || {} - for (const transport of this.transports) { - transport(level, message, meta, timestamp) - } - + // send every log to syslog add({ id: nanoid(), timestamp, @@ -303,6 +299,12 @@ export class Logger { message, metadata: meta, }) + + if (!enabledLogLevels[this.level].includes(level)) return + + for (const transport of this.transports) { + transport(level, message, meta, timestamp) + } } } diff --git a/src/logger/logDump.ts b/src/logger/logDump.ts index ec64bf4b..563b12aa 100644 --- a/src/logger/logDump.ts +++ b/src/logger/logDump.ts @@ -4,7 +4,7 @@ let entries: ConsoleTransportEntry[] = [] export function add(entry: ConsoleTransportEntry) { entries.unshift(entry) - entries = entries.slice(0, 50) + entries = entries.slice(0, 500) } export function getEntries() {