I have the following Log4J configurations, how I can delete the logs older than one month?
Define the root logger with appender file
log =log/
log4j.rootLogger = ERROR, FILE
Define the file appender
log4j.appender.FILE=org.apache.log4j.DailyRollingFileAppender
Set the name of the file
log4j.appender.FILE.File=${log}/server.log
Set the immediate flush to true (default)
log4j.appender.FILE.ImmediateFlush=true
Set the threshold to debug mode
log4j.appender.FILE.Threshold=debug
Set the append to false, should not overwrite
log4j.appender.FILE.Append=true
Set the DatePattern
log4j.appender.FILE.DatePattern='.' yyyy-MM-dd-a
Define the layout for file appender
log4j.appender.FILE.layout=org.apache.log4j.PatternLayout
log4j.appender.FILE.layout.conversionPattern=%m%n