Log4j .append=true property fail

2019-05-09 17:39发布

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

标签: java log4j
1条回答
干净又极端
2楼-- · 2019-05-09 18:27

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
查看更多
登录 后发表回答