Skip to content

Commit 77b7779

Browse files
committed
fix: bound production Console transport at debug level
Address Bugbot feedback on #1592. The previous 'silly' level meant the per-query Sequelize logging in src/config/config.js (logger.silly) would flood journalctl/stdout on busy instances, regardless of APP.LOG_LEVEL. That contradicts the goal of giving operators a clean operational log stream. Tighten the transport to 'debug', which still guarantees that error, warn, info, verbose, and debug reach journalctl (matching the application-%DATE%.log file content), but excludes the silly SQL trace. Operators who actually need per-query output can flip the transport level locally.
1 parent 0f54cc6 commit 77b7779

1 file changed

Lines changed: 12 additions & 10 deletions

File tree

src/config/logger.js

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -117,19 +117,21 @@ const createVersionLogger = (version) => {
117117
}),
118118
);
119119
} else {
120-
// In production, also stream every log line the logger emits to the
121-
// process's stdout/stderr so operators can consume the full log stream
122-
// via journalctl, pm2, or docker. File transports above continue to
123-
// hold the same data on disk. Errors go to stderr, everything else to
124-
// stdout.
120+
// In production, also stream debug-level and above to stdout/stderr so
121+
// operators can consume the log stream via journalctl, pm2, or docker
122+
// alongside the on-disk log files. Errors go to stderr, everything
123+
// else to stdout.
125124
//
126-
// NOTE: in winston 3 a transport's `level` is independent of the
127-
// logger's level, so we explicitly use 'silly' (the most permissive
128-
// level) to guarantee that anything the app logs reaches journalctl,
129-
// regardless of APP.LOG_LEVEL.
125+
// The explicit `level: 'debug'` is deliberate: winston 3 transport
126+
// levels are independent of the logger's level, and we want journalctl
127+
// to receive every "normal" log line (error through debug) regardless
128+
// of APP.LOG_LEVEL. The one level we deliberately exclude is `silly`,
129+
// which is reserved for extreme debugging (per-query Sequelize output
130+
// in src/config/config.js); operators who need that can flip the
131+
// transport to 'silly' temporarily.
130132
versionLogger.add(
131133
new transports.Console({
132-
level: 'silly',
134+
level: 'debug',
133135
stderrLevels: ['error'],
134136
format: format.combine(format.json()),
135137
}),

0 commit comments

Comments
 (0)