diff --git a/src/lib/logger/logger.ts b/src/lib/logger/logger.ts index 5a25f106e..21ef20438 100644 --- a/src/lib/logger/logger.ts +++ b/src/lib/logger/logger.ts @@ -122,7 +122,9 @@ export function setup(options: LoggerConfig | LoggerConfigItem = [DEFAULT_LOGGER const pinoConfig = { level: loggerConfig.level }; if (loggerConfig.type === 'file') { debug('logging file enabled'); - logger = createLogger(pinoConfig, pino.destination(loggerConfig.path), loggerConfig.format); + const destination = pino.destination(loggerConfig.path); + process.on('SIGUSR2', () => destination.reopen()); + logger = createLogger(pinoConfig, destination, loggerConfig.format); } else if (loggerConfig.type === 'rotating-file') { process.emitWarning('rotating-file type is not longer supported, consider use [logrotate] instead'); debug('logging stdout enabled');