How can I get log4j to delete old rotating log files? I know I can set up automated jobs (cron for UNIX and scheduled task for Windows), but I want it cross platform, and I
RollingFileAppender does this. You just need to set maxBackupIndex to the highest value for the backup file.
RollingFileAppender
maxBackupIndex