Hi,
Can someone please tell me how to use MaxBackupIndex in DailyRollingFileAppender.I know that the RollingFileAppender supports a maxBackupIndex property, but is there any workarounds for using MaxBackupIndex in DailyRollingFileAppender?
Hi,
Can someone please tell me how to use MaxBackupIndex in DailyRollingFileAppender.I know that the RollingFileAppender supports a maxBackupIndex property, but is there any workarounds for using MaxBackupIndex in DailyRollingFileAppender?
This feature is not available in current stable version (1.2) of Log4j.
Anyway you can explore the following: http ://wiki.apache.org/logging-log4j/DailyRollingFileAppender
Thanks a lot for your help. I've implemented this. Instead of overwriting the existing DailyRollingFileAppender, I created another class DailyRollingFileAppenderExt and copied the code provided in Wiki.In the log4j.properties file I'm referring to this clss log4j.appender.R=com.test.logger.DailyRollingAppenderExt log4j.appender.R.MaxBackupIndex=1
I'm logging this to testLog.log file. When I change the date to the next day, I don't see any bbackup file, just testLog.log file is present. What can be the reason for this?
You can take a look at
http://blog.justtechnologies.ca/2008/07/improving-log4j-dailyrollingfileappende.html