logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Steven Yang <kenshin...@gmail.com>
Subject Log files rename failed
Date Wed, 22 Jan 2014 02:42:14 GMT
I have observed a file-rename issue while using rolling appender.
I am using log4j2-beta9.
This main reason I switched to log4j2 is because the same problem occurs in
log4j 1.x and the only way to fix it is to modify the source which is
something we dont want to do unless it's the last option, while not
modifying any of our current source code.
Therefore addition to the log4j2 core jars we also have log4j-1.2-api.jar have
to replace the original log4j we also have binding from commons-logging to

The environment is running on a VM with Windows Server 2008 running
Websphere 8.

My configuration looks like

<RollingFile name="wmsRollingFile" fileName="${fileroot}/wms/wms.log"
      <PatternLayout pattern="%d [%t] %C %l %-5p %c - %m%n"/>
        <SizeBasedTriggeringPolicy size="10 MB"/>
        <TimeBasedTriggeringPolicy />

<logger name="org.springframework" level="debug" additivity="false">
        <appender-ref ref="wmsRollingFile"/>

    <logger name="org.apache.http" level="debug" additivity="false">
        <appender-ref ref="wmsRollingFile"/>

    <root level="info">
      <!-- <appender-ref ref="STDOUT"/> -->
      <appender-ref ref="wmsRollingFile"/>

I also have other appenders with similar setting but just logs to different
files. (they are not used/written much but do have same problem"

As you can see, I have set the log policy to size 10MB and by time.
What I have observed is that when it runs correctly, log files get gz at
10MB and restarts a new one and everything runs correctly. However, as soon
as one roll failed, the log size just keep increasing. When it comes to the
daily rolling part, a new file with correct timestamp is created. However
the original log file does not get cleaned up and the new logs just kept
append to the old log file. This causes log file size increase each day
with duplicated entries.

When I check the WAS error log I see something like the following:
"log4j:ERROR Failed to rename [D:/WMS_AP/logs/TWI900WMAPT01/wms/wms.log] to

Is there a way to see more detailed error message from log4j?
Or what could possibly be the problem? What should I investigate?


  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message