Open Codiving opened 1 year ago
Facing the same issue with Winston 2 and Winston-daily-file-rotate 3 Any inputs on this ?
I'm using the version below.
"winston": "^3.8.2", "winston-daily-rotate-file": "^4.7.1"
It should be like this --> maxFiles: '2d' Please check docs - https://www.npmjs.com/package/winston-daily-rotate-file
Check out how many audit.json
files are in your log directory, if there are more than one, it means your configuration problem
same problems. Maxfile not working....
Look like file will delete on this list new setting will generate new audit file, it not includes old file. Delete all file befor change log setting.
same problems ...
Same here with
"dependencies": {
[...]
"winston": "3.10.0",
"winston-daily-rotate-file": "4.7.1"
},
The usage of maxFiles with a value in days like maxFiles: '7d'
looks broken : no new file is created.
Updates appreciated
Same problem => version 4.7.1
@Codiving I think the problem you're having is because of this line: frequency: "1d"
. When you look at the documentation, you'll see that only "#m" or "#h"
are allowed. So, you need to change your code to frequency: "24h"
to make it work correctly.
same problems. Maxfile not working.... { "keep": { "days": true, "amount": 8 }, "auditLog": "/xx-audit.json", "files": [ { "date": 1718692539733, "name": "/xx/info-2024-06-18.log", "hash": "7ed5010ad75751bd9adf20403331a51060feef47b4d30290219e95992a2eac91" }, { "date": 1718726400005, "name": "/xx/info-2024-06-19.log", "hash": "708f6c151c554ead283234aa78e515c5edfb51d6545da1a9fdc7bc27e3c4f2f0" }, { "date": 1718812800006, "name": "/xx/info-2024-06-20.log", "hash": "9bc88a236a545548c41c68444f9ab18bab571161ab96168a034b49eeeb9c1c91" }, { "date": 1718899200006, "name": "/xx/info-2024-06-21.log", "hash": "b170cc49621c0e48f9354af4294ae3288cda0b7415cefcf7733f2242c978cd9c" }, { "date": 1718985600006, "name": "/xx/info-2024-06-22.log", "hash": "ecefffb54add0a73d0a3a3a5be675336d80698f52b4a1042e2732bcdf87d034a" }, { "date": 1719072000005, "name": "/xx/info-2024-06-23.log", "hash": "03e981f15d6af7f1eebb0943495daab5cd0d5c0ab1788927e71cc2d2cb1e797d" }, { "date": 1719158400005, "name": "/xx/info-2024-06-24.log", "hash": "cb926e49263b8f1a14c8c76c876368c89c792acc0f5bac85df957d0cd107f5e7" }, { "date": 1719244800006, "name": "/xx/info-2024-06-25.log", "hash": "8c221a0f1d234bd3320693dc40fd8a55a24a910122240c9fb34f357278314255" }, { "date": 1719331200005, "name": "/xx/info-2024-06-26.log", "hash": "6b61efd9e28472ed6ce4d04b26fa5cba09d79ede4b35ee0f87637069730d4c81" } ], "hashType": "sha256" } Does anyone know how to fix this?
I want a log file to be created every day. And I want to set the maximum number to 2. I have written code like below.
But, It's not working well. However, the log files are not being deleted as shown in the image below.
Is there any problem with my code? Thanks in advance for any help.