RTF
RTF

Reputation: 6494

Log4j DailyRollingFileAppender not rolling files

I have a log4j configuration that's intended to roll files when the my application runs once daily:

log4j.rootLogger=INFO, filer

log4j.appender.filer=org.apache.log4j.DailyRollingFileAppender
log4j.appender.filer.File=./logs/daily/daily.log
log4j.appender.filer.DatePattern='.'yyyy-MM-dd
log4j.appender.filer.layout=org.apache.log4j.PatternLayout
log4j.appender.filer.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %-5p %x - %m%n
log4j.appender.filer.append=true

...but everytime the application runs, the file daily.log gets truncated and overwritten. Am I doing something wrong?

Upvotes: 1

Views: 2356

Answers (1)

Hussein Zawawi
Hussein Zawawi

Reputation: 2927

Your configuration should be alright I suspect the following line is causing you problems.

log4j.appender.filer.append=true

Upvotes: 2

Related Questions