You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by Allistair Crossley <Al...@QAS.com> on 2004/03/15 16:27:59 UTC

Using MaxFileSize with DailyRollingFileAppender

Hi Guys

I appreciate that the DailyRollingFileAppender rolls daily as in its name, but what I am really looking for is to have log files generated whose filenames consist of the current date but also get rolled over based on a maxfilesize...something like the following, but this does not work. This is so that our log files do not get huge as we use a small java program to open them and it takes ages with a large file.

log4j.appender.ApplicationA=org.apache.log4j.DailyRollingFileAppender
log4j.appender.ApplicationA.File=application.log
log4j.appender.ApplicationA.MaxFileSize=200KB
#log4j.appender.ApplicationA.MaxBackupIndex=5
log4j.appender.ApplicationA.layout=org.apache.log4j.PatternLayout
log4j.appender.ApplicationA.layout.ConversionPattern=%d %-5p %l : %m%n

Cheers, ADC


<FONT SIZE=1 FACE="VERDANA,ARIAL" COLOR=BLUE> 
-------------------------------------------------------
QAS Ltd.
Developers of QuickAddress Software
<a href="http://www.qas.com">www.qas.com</a>
Registered in England: No 2582055
Registered in Australia: No 082 851 474
-------------------------------------------------------
</FONT>