I have the following logging problem with several Java applications using log4j
for logging:
I want log files to be rotated daily, like
Use the setting log4j.appender.FILE.RollingPolicy.FileNamePattern
, e.g. log4j.appender.FILE.RollingPolicy.FileNamePattern=F:/logs/filename.log.%d{dd}.gz
for keeping logs one month before rolling over.
I didn't wait for one month to check but I tried with mm (i.e. minutes) and confirmed it overwrites, so I am assuming it will work for all patterns.