我正在使用log4j(HTML布局),该文件不会每天都在下面的log4j.xml中滚动。我正在使用log4j附加功能。如果我使用log进入一个简单的日志文件,它可以正常工作但不适用于html布局。
<?xml version="1.0" encoding="windows-1252"?>
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd" >
<log4j:configuration>
<!-- Daily Rolling File Appender that compresses old files -->
<appender name="file" class="org.apache.log4j.rolling.RollingFileAppender" >
<param name="threshold" value="info"/>
<rollingPolicy name="file" class="org.apache.log4j.rolling.TimeBasedRollingPolicy">
<param name="FileNamePattern" value="${catalina.home}/ApplicationLogs/ApplicationLogs-%d{yyyy-mm-dd}.html"/>
<param name="ActiveFileName" value="${catalina.home}/ApplicationLogs/ApplicationLogs.html"/>
</rollingPolicy>
<layout class="org.apache.log4j.HTMLLayout" >
<param name="LocationInfo" value="true" />
</layout>
</appender>
<root>
<priority value="debug"></priority>
<appender-ref ref="file" />
</root>
</log4j:configuration>