views:

399

answers:

1

Hi,

Are there any known bugs with the Log4J rolling file appender. I have been using log4j happily for a number of years but was not aware of this. A colleague of mine is suggesting that there are known issues ( and i found one a Bugzilla entry on this) where under heavy load,the rolling file appender (we use the time-based one) might not perform correctly when the rollover occurs @ midnight.

Bugzilla entry - https://issues.apache.org/bugzilla/show_bug.cgi?id=44932

Appreciate inputs and pointers on how others overcome this.

Thanks, Manglu

+1  A: 

Hi Manglu,

I have not encountered this issue myself, and from the bug report, I would suspect that it is very uncommon. Th Log4j RollingFileAppender has always worked in a predictable and reliable fashion for the apps I have developed and maintained.

This particular bug, If I understand correctly, would only happen if there are multiple instances of Log4j, like if you had multiple instances of the same app running simultaneously, writing to the same log file. Then, when it is rollover time, one instance cannot get a lock on the file in order to delete it and archive its contents, resulting in the loss of the data that was to be archived.

I cannot speak to any of the other known bugs your colleague mentioned unless you would like to cite them specifically. In general, I believe Log4j is reliable for production apps.

kg
Hi Konstantin,That has been my observation too. I have safely used log4j for a number of years. I will investigate and report back. Thanks,Manglu
Manglu