I know that log4j provides RollingFileAppender and DailyRollingFileAppender classes, however, DailyRollingFileAppender does not support MaxFileSize property.

How do I tweak the behavior of log4j so that it can log in a way like this: the rolling policy is based on both time period (and file name is appended with DatePattern), like in DailyRollingFileAppender, and MaxFileSize (like in RollingFileAppender)?

Example: The log file rolls every hours, but the maxFileSize is limited to 1MB. During the period of the roll over schedule check, if an event of exceeding maxFileSize occurs, the log file should roll over as well?