Hi,
Problem i have with log4j is that when i specify maxfilesize it works properly for the files generated in the src folder of project, but the log files generated in tomcat bin, are not splited into seperate files and then i have a large log file which is not desirable. The following is log4j.xml:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd" >
<log4j:configuration>
<appender name="fatalFile" class="org.apache.log4j.RollingFileAppender">
<param name="MaxFileSize" value="100KB" />
<param name="MaxBackupIndex" value="5" />
<param name="File" value="logs/pnusn/fatal.log" />
<param name="threshold" value="fatal" />
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%5p in Class:%C{2}, Thread:%t, at:%d{ABSOLUTE}:: '%m'%n" />
</layout>
</appender>
<appender name="othersFile" class="org.apache.log4j.RollingFileAppender">
<param name="MaxFileSize" value="100KB" />
<param name="MaxBackupIndex" value="5" />
<param name="File" value="logs/pnusn/others.log" />
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%5p in Class:%C{2}, Thread:%t, at:%d{ABSOLUTE}:: '%m'%n" />
</layout>
<filter class="org.apache.log4j.varia.LevelRangeFilter">
<param name="LevelMin" value="debug" />
<param name="LevelMax" value="error" />
</filter>
</appender>
<appender name="traceFile" class="org.apache.log4j.RollingFileAppender">
<param name="MaxFileSize" value="200KB" />
<param name="MaxBackupIndex" value="20" />
<param name="File" value="logs/pnusn/trace.log" />
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%5p in Class:%C{2}, Thread:%t, at:%d{ABSOLUTE}:: '%m'%n" />
</layout>
<filter class="org.apache.log4j.varia.LevelRangeFilter">
<param name="LevelMin" value="trace" />
<param name="LevelMax" value="trace" />
</filter>
</appender>
<root>
<priority value="trace"></priority>
<appender-ref ref="fatalFile" />
<appender-ref ref="othersFile" />
<appender-ref ref="traceFile" />
</root>
</log4j:configuration>
Does anybody know how can i fix it?
Thanks for your consideration.