Hello-
I am new to log4j. This is teh first time I am setting it up for my
application. I want to keep the log files which are ONLY 3 days old and
newer. Any log file older than 3 days should get deleted. And I have
specified using the MaxBackupIndex property. But still the files never get
deleted. I have to manually delete them. Can some give some pointers/tips as
to why this is not happening as expected. Here is my log4j.properties.
Thanks.


# initialise root logger with level INFO
log4j.rootLogger=INFO,LOGMAIN

# LOGMAIN APPENDER
log4j.appender.LOGMAIN=org.apache.log4j.DailyRollingFileAppender
log4j.appender.LOGMAIN.layout=org.apache.log4j.PatternLayout
log4j.appender.LOGMAIN.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss.SSS}
%-5p %m%n
log4j.appender.LOGMAIN.DatePattern='.'yyyy-MM-dd-a
log4j.appender.LOGMAIN.File=/log4j.txt
log4j.appender.LOGMAIN.MaxBackupIndex=3

Reply via email to