Hi,
  We currently use Log4J version 1.2.16 in our product. We have a 
multi-threaded application and notice this crazy problem. Hope someone would 
have a clue about this.

For testing purpose

1. We create an object of TimeAndSizeRollingAppender.
2. Set the rollover pattern to every minute.
3. Start pushing in data using the MDC.put() in a loop for a count of say 100000

Problem

Log4j starts to rollover the files.

File name = duplicate.siem.2020-11-24-20-07.1 (first file)

Counter=1
Counter=2
..
..


File name= duplicate.siem.2020-11-24-20-07.2 (second file)

Counter=196240 (duplicate entry)
Counter=196240
Counter=196241


All rolled over files have the same issue. The first log line will have 
duplicate entries.

Thanks,
Sailesh.

Reply via email to