Skip to content

Commit 0adf362

Browse files
committed
fix: stream all production logs to stdout/stderr for journalctl
The previous production Console transport was filtered to error level, which kept journalctl quiet but left operators who consume logs via journalctl/pm2/docker without the info/warn context around failures. Drop the level filter so the transport inherits the logger's configured level (APP.LOG_LEVEL, default info). Errors still go to stderr via stderrLevels; everything else goes to stdout. File transports are unchanged, so the full on-disk log files continue to be written. Set LOG_LEVEL=debug in CADT config to also stream verbose/debug.
1 parent 56cca04 commit 0adf362

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

src/config/logger.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,11 +117,12 @@ const createVersionLogger = (version) => {
117117
}),
118118
);
119119
} else {
120-
// In production, mirror error-level logs to stderr so operators can see
121-
// them via journalctl/pm2/docker alongside the on-disk log files.
120+
// In production, also stream every log line the logger emits to the
121+
// process's stdout/stderr so operators can consume them via journalctl,
122+
// pm2, or docker. File transports above continue to hold the same data
123+
// on disk. Errors go to stderr, everything else to stdout.
122124
versionLogger.add(
123125
new transports.Console({
124-
level: 'error',
125126
stderrLevels: ['error'],
126127
format: format.combine(format.json()),
127128
}),

0 commit comments

Comments
 (0)