Log4j: DailyRollingFileAppender with MaxFileSize Option
You could extend the FileAppender class and implement your custom version. More details DailyRollingFileAppender
You could use DailyRollingFileAppender
with the hourly backup option. This will rollover the logs every hour.
Hourly Usage:
log4j.appender.A1.datePattern='.'yyyy-MM-dd-HH