ppkarwasz commented on issue #1714:
URL:
https://github.com/apache/logging-log4j2/issues/1714#issuecomment-1685602718
@nateinindy,
Thanks a lot for the pictures. Here's what is going on:
1. In the first picture the behavior is **expected**, since 20:20:05 is the
time of the next expected **time-based** rollover. That is why you need `%i` in
the pattern,
1. In the second picture you observe the "rotating window" feature of the
rollover strategy. If the `fileIndex` property of the strategy has value "min"
or the default "max", then the `%i` pattern will only go from the value of the
`min` property (default 1) to the value of the `max` property (default 7). When
the window is full, the oldest file will be deleted to make space for a new
one. What you are looking for is:
```
appender.file.strategy.fileIndex = nomax
```
This will disable the "rotating window".
1. In the third picture your timestamp is too coarse. If you expect multiple
rotations in the same minute, you still need `%i`, even with a
`DirectWriteRolloverStrategy`. Try switching to a millisecond period and modify
`interval` accordingly:
```
appender.file.filePattern =
/tmp/data/messages.log.%d{yyyyMMddHHmmssSSS}.gz
...
appender.file.policies.time.interval = 120000
appender.file.policies.time.modulate = true
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]