tags:

views:

51

answers:

1

I am using log4j (2.1.16) with a DailyRollingFileAppender, with the append property set to true. However, everytime I restart the web application it does not append, it simply overwrites the file.

log4j.appender.eformsAccess=org.apache.log4j.DailyRollingFileAppender 
log4j.appender.eformsAccess.file=to be set in the code(SchemeActionBean.java)
log4j.appender.eformsAccess.datePattern='.'yyyyMMdd
log4j.appender.eformsAccess.append=true
log4j.appender.eformsAccess.ImmediateFlush=true
log4j.appender.eformsAccess.layout=org.apache.log4j.PatternLayout
log4j.appender.eformsAccess.layout.ConversionPattern=%d{ISO8601} %m %n

So what am I doing wrong?

cheers

+1  A: 

I guess there are some case-sensitive typos. "File" and "Append" starts with a capital:

log4j.appender.eformsAccess.File=someFileNamePlease.log
log4j.appender.eformsAccess.Append=true
Michael Konietzka
Case sensitive indeed. Once all properties were made upprercase it worked.
Davoink
Just to add to this. I had real problems in development with this. The file would append great, even on server restart. But if any code was recompiled it would not append and always create a new file everytime.
Davoink