To use the file size in a rolling file appender, you can use something like this:

log4j.appender.out=org.apache.log4j.RollingFileAppender
log4j.appender.out.layout=org.apache.log4j.PatternLayout
log4j.appender.out.layout.ConversionPattern=%d{ABSOLUTE} | %-5.5p | %-16.16t
log4j.appender.out.File=test.log
log4j.appender.out.Append=false
log4j.appender.out.Threshold=DEBUG
log4j.appender.out.MaxFileSize=5MB
log4j.appender.out.MaxBackupIndex=2

Regards
JB

On 07/05/2010 07:01 PM, Gert Vanthienen wrote:

L.S.,

I haven't tried with a size based rolling criterium yet, but this snippet
below is working fine for me (daily rolling appender):

# File appender
log4j.appender.out=org.apache.log4j.DailyRollingFileAppender
log4j.appender.out.layout=org.apache.log4j.PatternLayout
log4j.appender.out.DatePattern='.'yyyy-MM-dd
log4j.appender.out.layout.ConversionPattern=%d{ABSOLUTE} | %-5.5p | %-16.16t
| %-32.32c{1} | %-32.32C %4L | %m%n
log4j.appender.out.file=${karaf.base}/data/log/servicemix.log
log4j.appender.out.append=true

Could you give that a go as well so we can figure out if it the
RollingFileAppender that is not being picked up correctly or if it is
something else in your logging setup that is causing the issue?

-----
Regards,

Gert Vanthienen
------------------------
Open Source SOA: http://fusesource.com
Blog: http://gertvanthienen.blogspot.com/

Reply via email to