dateFile Appender daysToKeep not rolling by days
envgap__log4js-node__log4js-node-1035
01 / FAILURE SIGNATURE
As reported upstream
No identifying execution failure has been captured.
Not a benchmark task.
- In a clean container the reported failure did not reproduce, or the known fix did not make the project run.
02 / ENVIRONMENT RECIPE
- Base commit
89fe50b5aa3c1df1fa73621b1e5c3351aa29bbfd- Manifest
package.json- Reproduce
Awaiting issue-specific recipe- Run under trace
Awaiting a meaningful runtime command
03 / ORIGINAL ISSUE TEXT
log4js-node/log4js-node #1035 · read the original issue
> 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
```04 / LABELS
Labels from the report text only; not yet run
No supported category has been assigned.
Label rules and the text that matched
[]