I am using log4j1.2.17 and apache-extras-log4j--1.2.17.jar for logging.
My purpose is to roll and archive the file based on size.Below is the log4j.xml
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
<appender name="R" class="org.apache.log4j.rolling.RollingFileAppender">
<param name="File" value="logger.log"/>
<param name="append" value="true"/>
<param name="encoding" value="UTF-8"/>
<rollingPolicy class="org.apache.log4j.rolling.FixedWindowRollingPolicy">
<param name="FileNamePattern" value="logger.log%i.gz" />
</rollingPolicy>
<triggeringPolicy class="org.apache.log4j.rolling.SizeBasedTriggeringPolicy">
<param name="MaxFileSize" value="${LOG_FILESIZE_LIMIT}"/>
</triggeringPolicy>
<layout class="org.apache.log4j.TTCCLayout">
<param name="ContextPrinting" value="true"/>
<param name="ThreadPrinting" value="true"/>
<param name="DateFormat" value="MM/dd/yyyy HH:mm:ss"/>
</layout>
</appender>
<root>
<priority value ="DEBUG"/>
<appender-ref ref="R"/>
</root>
</log4j:configuration>
${LOG_FILESIZE_LIMIT} is 100MB.
But its not setting the MaxFileSize to 100MB and gives below message.
log4j:WARN Failed to set property [maxFileSize] to value "100MB"
Its taking default maxfilesize which is 10MB and archiving the file once it reaches to 10MB.
Thanks, Anjali