diff --git a/src/lib/logger.js b/src/lib/logger.js index dd8bac2ee..5b2b38f92 100644 --- a/src/lib/logger.js +++ b/src/lib/logger.js @@ -93,6 +93,10 @@ function setup(logs) { }, }); + process.on('SIGUSR2', function() { + Logger.reopenFileStreams(); + }); + module.exports.logger = logger; } diff --git a/wiki/logger.md b/wiki/logger.md index 97536dbb0..3ab58554f 100644 --- a/wiki/logger.md +++ b/wiki/logger.md @@ -10,6 +10,8 @@ logs: - {type: file, path: verdaccio.log, level: info} ``` +Use `SIGUSR2` to notify the application, the log-file was rotated and it needs to reopen it. + ### Configuration Property | Type | Required | Example | Support | Description