You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by Bart Berger <bb...@Brocade.COM> on 2011/12/15 01:36:01 UTC

RollingFileAppender stops logging during rollover

Hi,

RollingFileAppender intermittently stops logging during rollover.  Anybody else seen this, or know a workaround?

Here's the appender definition in log4j.xml:

   <appender name="MONITOR" class="org.jboss.logging.appender.RollingFileAppender">
    <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
    <param name="File" value="${dcm.home.dir}/logs/server/monitor.log"/>
    <param name="Append" value="true"/>
    <param name="MaxFileSize" value="10MB"/>
    <param name="MaxBackupIndex" value="5"/>
    <layout class="org.apache.log4j.PatternLayout">
      <param name="ConversionPattern" value="%d %-5p [%c] %m%n"/>
    </layout>
  </appender>

Occasionally, when monitor.log reaches 10MB it is successfully renamed and a new monitor.log file is created.  But the new file remains empty, and no more logging occurs.

There are no other appenders defined that use the name monitor.log, and no other JVMs logging to the same file.  There are no editors or other applications opening the log files (no 'tail' running, for example).

We are using log4j version 1.2.16 running on Windows Server 2008 R2 (64-bit).  The application runs under JBoss AS 5.1.0.  Just to be safe, I updated the log4j.jar in JBoss's folders to version 1.2.16 also, but it didn't help.

Any suggestions on where to go from here?

Thanks much,
Bart Berger
bberger@brocade.com