To do size-based rollover, update the numeric value of the following lines:
log4j.appender.file.MaxFileSize=10MB
log4j.appender.file.MaxBackupIndex=5
These lines limit the log file size to 10 MB and the number of backup files to 5.
You can also do time-based rollover, set a date, or do daily rollover. To do a daily rollover, change log4j.appender.file=org.apache.log4j.FileAppender to log4j.appender.file=org.apache.log4j.DailyRollingFileAppender. This change rolls over the log file every midnight.