Things get interesting when you want to use this one with log4j. log4j has DailyFileAppender
This is the one everybody ends up using, But the trouble here is you can never configure it correctly to work with logroatate. Nor should you try, It's like two programs are trying to do the same thing...
The closest thing to logroate in log4j is
you can configure it to a very high max size (say 1 GB) and set Maxbackupindex to zero ! . It is kind of an way of using it as a FileAppender with a max cap on size. After this it's logroate's job to take care of rotation and retaintion.
Typical log4j Appender
<param name="MaxFileSize" value="1GB" />
<param name="MaxBackupIndex" value="0" />
<param name="File" value="/path/to/log" />
Retain 4 weeks worth of log.