-
Notifications
You must be signed in to change notification settings - Fork 156
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
After restart server, last time's newest log file is not archived and oldest log file is not deleted #296
Comments
fix don't emitting event about deleting oldest file which should be emitted each time when server restarting (winstonjs/winston-daily-rotate-file#296 issue) reason in double emitting "new" event when app started, and first emit happens before stream returning and no one can hear "logRemoved" event
event "rotate" not emitted when app started, it may be have sense because literally rotate code doesn't run, only creating new file happen, but when it happen we can find path to last old log file in auditLog.files and then archive it. (winstonjs#296 issue)
This bug just bit us hard, do we know if this is still an issue in the latest version? |
@aaronjameslang seems likely, but if you have a great test case handy you might be in the best position to test it! |
According to our tests this is still an issue in 4.6.1 Our workaround for now is increased disk space monitoring/alerting and investigating options to log to the network rather than disk |
If option
|
Perhaps more clarification.
Now |
I created PR into file-stream-rotator rogerc/file-stream-rotator#100 |
Description
After restart node server:
The last time's newest log file is not archived.
The last time's oldest archived log file is not deleted when exceed maxFiles.
Version
4.5.0
Log settings
Test steps
Pin@ubuntu # ll -t -r logs/ -rw-r--r-- 1 root root 69 Oct 12 18:23 application-2020-10-12-18-23:01.log.gz -rw-r--r-- 1 root root 69 Oct 12 18:23 application-2020-10-12-18-23:02.log.gz -rw-r--r-- 1 root root 69 Oct 12 18:23 application-2020-10-12-18-23:03.log.gz -rw-r--r-- 1 root root 50 Oct 12 18:23 application-2020-10-12-18-23:05.log -rw-r--r-- 1 root root 69 Oct 12 18:23 application-2020-10-12-18-23:04.log.gz -rw-r--r-- 1 root root 1039 Oct 12 18:23 .4fdb28c558b05eafd9ee9c1d1660cb8f60f66f53-audit.json
4 Check log files
Pin@ubuntu # ll -t -r logs/ -rw-r--r-- 1 root root 69 Oct 12 18:23 application-2020-10-12-18-23:01.log.gz -rw-r--r-- 1 root root 50 Oct 12 18:23 application-2020-10-12-18-23:05.log -rw-r--r-- 1 root root 20 Oct 12 18:23 application-2020-10-12-18-23:08.log.gz -rw-r--r-- 1 root root 69 Oct 12 18:23 application-2020-10-12-18-23:09.log.gz -rw-r--r-- 1 root root 50 Oct 12 18:23 application-2020-10-12-18-23:11.log -rw-r--r-- 1 root root 69 Oct 12 18:23 application-2020-10-12-18-23:10.log.gz -rw-r--r-- 1 root root 1039 Oct 12 18:23 .4fdb28c558b05eafd9ee9c1d1660cb8f60f66f53-audit.json
Expected:
application-2020-10-12-18-23:05.log
should be archivedapplication-2020-10-12-18-23:01.log.gz
should be deletedTest Script
test.js
The text was updated successfully, but these errors were encountered: