I had a customer who asked about jboss log rotation, specifically deleting older files to avoid running low on disk spacce. By default we use the DailyRollingFileAppender which does not include any functionality to delete older files.
We discussed using a size based file rolling file appender which has the MaxBackupIndex parameter which specifies the number of files to keep, but this makes debugging a little harder than when you have daily files which allow you to determine which old log file contains entries from a specific date.
We decided the best approach to take was to keep using DailyRollingFileAppender and then schedule a script to delete the older files.
I wrote the attached batch script which, by default, keeps the last 28 (this can be changed) server.log.yyyy-mm-dd files. Instructions in comments in the file.