rgoers edited a comment on issue #271: Proposed fix for LOG4J2-2610 rollover 
issue:
URL: https://github.com/apache/logging-log4j2/pull/271#issuecomment-502503385
 
 
   Thanks. That is perfect and is exactly what I expected. From the log we see 
   ```
   2019-06-16 20:39:01,573 main DEBUG RollingFileManager executing synchronous 
FileRenameAction[target/rolling-size-test/rolling.log to 
target/rolling-size-test/rollingtest-2019-06-167T20-39-01-573.log, 
renameEmptyFiles=false]
   2019-06-16 20:39:01,573 main TRACE Renamed file 
/Volumes/git/logging-log4j2/log4j-core/target/rolling-size-test/rolling.log to 
/Volumes/git/logging-log4j2/log4j-core/target/rolling-size-test/rollingtest-2019-06-167T20-39-01-573.log
 with Files.move
   2019-06-16 20:39:01,573 main DEBUG Now writing to 
target/rolling-size-test/rolling.log at 2019-06-16T20:39:01.573-0400
   2019-06-16 20:39:01,573 main DEBUG Formatting file name. 
useCurrentTime=false, currentFileTime=0, prevFileTime=0
   2019-06-16 20:39:01,573 main DEBUG Formatting file name. 
useCurrentTime=false, currentFileTime=0, prevFileTime=0
   2019-06-16 20:39:01,574 main TRACE DefaultRolloverStrategy.purge() took 0.0 
milliseconds
   2019-06-16 20:39:01,574 main DEBUG RollingFileManager executing synchronous 
FileRenameAction[target/rolling-size-test/rolling.log to 
target/rolling-size-test/rollingtest-2019-06-167T20-39-01-573.log, 
renameEmptyFiles=false]
   ```
   
   So the file rolled over twice within the same millisecond. The second 
rollover overwrote the first. The easy fix for this is to add %i to the 
filename pattern. The other way to do it is add calls to sleep in the logging 
loop.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to