javalog4jfileappender

log4j file appender do not normal


My log4j.properties is:

log4j.appender.R.File=../logs/xrzgather.log
log4j.appender.R.MaxFileSize=10MB
log4j.appender.R.MaxBackupIndex=100

I have many tomcat server run the application,and all of them run normal with the right log but one of them do not normal,it generate the log file:

    xrzgather.log  182M  
    xrzgather.log.19  254M  
    xrzgather.log.45  48.6M  
    xrzgather.log.50  400M  
    xrzgather.log.90  20.8M  
    xrzgather.log.92  66.3M  
    xrzgather.log.99  11.9M

Has anyone know what's wrong?


Solution

  • I find the reason..
    I config a Context element in %tomcat_home%\conf\Server.xml like this:

    <Context path="xrz-gather" docBase="xrz-gather-web-1.0-SNAPSHOT" />
    

    if I remove this,log will be normal.