我的一些log4j条目将转到托管服务器输出文件。这并不是一直都在发生。我的log4j设置了INFO用于所有内容,但是当它转到out文件时,我所有的DEBUG都被记录了。可能导致这种情况的原因是什么?
这是log4j.xml文件:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
<!-- ===================================================================== -->
<!-- -->
<!-- Log4j Configuration -->
<!-- -->
<!-- ===================================================================== -->
<!-- $Id: log4j.xml,v 1.13.2.3 2003/05/02 00:53:12 slaboure Exp $ -->
<!--
| For more configuration infromation and examples see the Jakarta Log4j
| owebsite: http://jakarta.apache.org/log4j
-->
<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/"
debug="false">
<!-- =================Appenders for CSF=================-->
<appender name="CSF_FILE"
class="gov.va.integration.core.logging.ExceptionCRRollingFileAppender">
<!-- <param name="Threshold" value="INFO" /> -->
<!-- <param name="File" value="${logFile.location}" /> -->
<param name="File" value="./servers/${weblogic.Name}/logs/myapp/myapp.log" />
<param name="Append" value="true" />
<param name="MaxFileSize" value="50000KB" />
<param name="MaxBackupIndex" value="10"/>
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="[%d{yyyy-MM-dd'T'HH:mm:ss,SSSZ} %-5p][%t](%F:%L): %c - %m\r%n" />
</layout>
</appender>
<!-- =================Appenders for Events=================-->
<appender name="EVENT_FILE"
class="org.apache.log4j.RollingFileAppender">
<param name="Threshold" value="INFO" />
<param name="File" value="" />
<param name="Append" value="true" />
<param name="MaxFileSize" value="500KB" />
<param name="MaxBackupIndex" value="1" />
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%d %-5p [%c] %m%n" />
</layout>
</appender>
<!--=================End Appenders for Event================= -->
<!-- ============================== -->
<!-- Append messages to the console -->
<!-- ==============================-->
<appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
<param name="Target" value="System.out" />
<!-- <param name="Threshold" value="INFO" /> -->
<layout class="org.apache.log4j.PatternLayout">
<!-- The default pattern: Date Priority [Category] Message\n -->
<param name="ConversionPattern"
value="[%d{yyyy-MM-dd'T'HH:mm:ss,SSSZ} %-5p]: myapp %c - %m\r%n" />
<param name="ConversionPattern"
value="[%d{yyyy-MM-dd'T'HH:mm:ss,SSSZ} %-5p]: myapp %c - %m\r%n" />
</layout>
</appender>
<appender name="JSR77" class="org.apache.log4j.FileAppender">
<param name="Append" value="false" />
<param name="File" value="/log/jsr77.log" />
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern"
value="%d{ABSOLUTE} %-5p [%c{1}] %m%n" />
</layout>
</appender>
<!-- ====================== -->
<!-- More Appender -->
<!-- ====================== -->
<!-- Buffer events and log them asynchronously -->
<appender name="ASYNC" class="org.apache.log4j.AsyncAppender">
<appender-ref ref="CSF_FILE" />
<appender-ref ref="EVENT_FILE" />
</appender>
<!-- ================ -->
<!-- Limit categories -->
<!-- ================ -->
<!-- Limit categories to INFO
<category name="">
<priority value="INFO"/>
</category>
-->
<!--
RULES for logging DEBUG < INFO < WARN < ERROR < FATAL.
-->
<!-- tested and run
<category name="*" additivity="false">
<priority value="ERROR" />
</category>
-->
<!--
Decrease the priority threshold
<category name="">
<priority value="DEBUG"/>
</category>
-->
<!-- Setup the Root category -->
<root>
<priority value="INFO"/>
<appender-ref ref="CSF_FILE" />
</root>
</log4j:configuration>