-
Notifications
You must be signed in to change notification settings - Fork 155
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
Incorrect mapping of files in audit.json file #359
Comments
At first glance, it looks like the file may have been locked by some process (e.g. an automated backup) at the time the deletion was attempted. |
How to avoid this situation and have proper rotation/deletion of logs ? Note: Also tried removing the file manually from the audit.json but the file gets deleted. |
Why do you have multiple Node processes writing to the same log file? You could consider having separate processes log into separate log directories and disabling automated lockers (e.g. backup processes) if you want to increase the probability of correct rotation/deletion of logs. |
It is required by the application to log only 1 file from all the Node processes. So, no much control over it. |
The automated locking is a file-system feature. What would you expect the result to be if one process tried to write to a file while another process tried to delete it at the same time? |
Versions:
winston: ^2.4.5
winston-daily-rotate-file: ^3.10.0
Node JS: v12.22.0
OS: Debian 11 Bullseye
During the logs rotate mechanism, some of the files are not deleted from the logs directory.
Upon investigation, it is found that the -audit.json file has missing files that made it to not get deleted.
Winston Settings:
The audit.json file is as on 18th Oct 2022. Here, the 17th Oct 2022 file is missing in the audit.json file and this file (Logs-2022-10-17.log) was not deleted from the logs directory.
Requesting a resolution on the issue.
The text was updated successfully, but these errors were encountered: