Log4j Rollingfileappender Behaviour With Weblogic on Windows (Doc ID 1374885.1)

Last updated on NOVEMBER 05, 2016

Applies to:

Oracle Weblogic Server - Version: 10.3.2 and later   [Release: and later ]
Generic Windows

Symptoms

After deploying on WebLogic an application where Log4j RollingFileAppender class is used
the logging works as expected : files rotate when their limit is reached and backups are kept.

Here a sample of log4j configuration:

<appender name="TEST_APPENDER" class="org.apache.log4j.RollingFileAppender">
<param name="Threshold" value="debug"/>
<param name="File" value="D:/Oracle_env/user_projects/domains/base_domain/applications/logs/TestLogger.log"/>
<param name="Append" value="true"/>
<param name="MaxFileSize" value="1KB"/>
<param name="MaxBackupIndex" value="2"/>
<layout class="org.apache.log4j.PatternLayout">
<param name="conversionPattern" value="%d %-5p %c %x - %m%n"/>
</layout>
</appender>



But once the Admin Console is accessed the behaviour of the RollingFileAppender changes : the log file rotation doesn't work anymore only one occurence of the file is kept.

This happens only on Microsoft Windows machines.



Cause

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms