日志文件没有正确附加

时间:2013-01-19 10:42:19

标签: logging log4j

在我的应用程序中使用... log4j文件Appender无法正常工作... 我的日志文件大小保持3000kB,之后新的日志文件没有创建,它覆盖了现有的日志文件......

它没有创建loggy.log,loggy.log1,loggy.log2 ....

当它达到3000KB时,它会覆盖loggy.log ......

问题是什么......

继承我的log4j.properties

log4j.watch=true
log4j.readtime=30000

log4j.rootCategory=DEBUG, applicationlogging
log4j.rootCategory=DEBUG, strutslogging


log4j.category.applicationlogging = DEBUG, applicationlogging


##set logging level for HttpClient
log4j.logger.org.apache.commons.httpclient=DEBUG
log4j.logger.httpclient.wire.header=OFF
log4j.logger.httpclient.wire.content=OFF
log4j.additivity.applicationlogging = false
log4j.additivity.strutslogging = false

# inven.log
log4j.appender.applicationlogging=org.apache.log4j.RollingFileAppender
#log4j.appender.applicationlogging.File=C:/Program Files/Apache Software Foundation/Tomcat6.0/webapps/Project/WEB-INF/logs/loggy.log
log4j.appender.applicationlogging.File=E:/Final/Project/WebContent/WEB-INF/logs/loggy.log
#og4j.appender.applicationlogging.File=C:/Program Files (x86)/Apache Software Foundation/Tomcat 6.0/webapps/Project/WEB-INF/logs/loggy.log
log4j.appender.applicationlogging.MaxFileSize=3000KB
log4j.appender.applicationlogging.MaxBackupIndex=50
log4j.appender.applicationlogging.layout=org.apache.log4j.PatternLayout
log4j.appender.applicationlogging.layout.ConversionPattern=%d - %m%n

1 个答案:

答案 0 :(得分:0)

尝试添加此内容:

   log4j.appender.applicationlogging.Append=true