- Notifications
You must be signed in to change notification settings - Fork 768
Closed
log4js-node/streamroller
#78Closed
Copy link
Milestone
Description
daysToKeep - integer (default 0) - if this value is greater than zero, then files older than that many days will be deleted during log rolling.
when the pattern is not .yyyy-MM-dd
, the daysToKeep not work as doc says.
for example. when pattern is .yyyy-MM-dd-hh-mm
, the daysToKeep is not control the old log Rolling by days, just keep the logs backups not more than daysToKeep.
log4js.configure({ appenders: { well: { type: 'dateFile', filename: logFileName, pattern: '.yyyy-MM-dd-hh-mm', compress: true, daysToKeep: 3 }, console: { type: 'console' } }, categories: { well: { appenders: [ 'well' ], level: 'debug'}, default: {appenders: ['console'], level: 'debug'} } })
log files
-rw-r--r-- 1 dd staff 855B Aug 1 14:59 well.log -rw-r--r-- 1 dd staff 197B Aug 1 14:39 well.log.2020-08-01-14-38.gz -rw-r--r-- 1 dd staff 323B Aug 1 14:45 well.log.2020-08-01-14-39.gz -rw-r--r-- 1 dd staff 140B Aug 1 14:59 well.log.2020-08-01-14-45.gz
Metadata
Metadata
Assignees
Labels
No labels