mirror of
https://github.com/verdaccio/verdaccio.git
synced 2024-12-16 21:56:25 -05:00
fix: fatal exception and crash when log rotate signal event is called (#1774)
fix #1709
This commit is contained in:
parent
4cf61d6e8c
commit
1a9a12e918
1 changed files with 9 additions and 1 deletions
|
@ -150,7 +150,15 @@ function setup(logs, { logStart } = { logStart: true }) {
|
|||
}
|
||||
|
||||
process.on('SIGUSR2', function() {
|
||||
Logger.reopenFileStreams();
|
||||
// https://github.com/trentm/node-bunyan#stream-type-rotating-file
|
||||
if (logger) {
|
||||
/**
|
||||
* Note on log rotation: Often you may be using external log rotation utilities like logrotate on Linux or logadm
|
||||
* on SmartOS/Illumos. In those cases, unless your are ensuring "copy and truncate" semantics
|
||||
* (via copytruncate with logrotate or -c with logadm) then the fd for your 'file' stream will change.
|
||||
*/
|
||||
logger.reopenFileStreams();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue