我们已经logger.debug()
在代码中编写了一些语句,但它在下面的 fachene 中打印了两次。
2012-10-17 10:53:34,791,MessageListenerThreadPool:0,[包名],进入方法(),2012-10-17 10:53:34,791 MessageListenerThreadPool:0 DEBUG [包名]进入方法()
请帮助我为什么它打印两次?
下面是我的 log4j 配置。
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="false">
<appender name="infoLogsFile" class="org.apache.log4j.FileAppender">
<param name="File" value="Application.log"/>
<param name="Threshold" value="DEBUG"/>
<layout class="org.apache.log4j.PatternLayout">
<!-- The default pattern: Date Priority [Category] Message\n -->
<param name="ConversionPattern" value="%d %t %-5p [%c] %m%n"/>
</layout>
</appender>
<appender name="fatalLogsFile" class="org.apache.log4j.FileAppender">
<param name="File" value="Application_Func_Point.log"/>
<param name="Threshold" value="FATAL"/>
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%d, %t, [%c], %m, %n,"/>
</layout>
</appender>
<appender name="custom" class="org.apache.log4j.RollingFileAppender">
<param name="File" value="Application.log"/>
<param name="Append" value="true"/>
<param name="Threshold" value="DEBUG"/>
<param name="MaxFileSize" value="75000KB"/>
<param name="maxBackupIndex" value="500"/>
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%d, %t, [%c], %m, %n,"/>
</layout>
</appender>
<logger name="com.unisys"> `
<level value="debug" />
</logger>
<!-- ======================= -->
<!-- Setup the Root category -->
<!-- ======================= -->
<root>
<priority value ="debug" />
<appender-ref ref="custom"/>
<appender-ref ref="fatalLogsFile"/>
<appender-ref ref="infoLogsFile"/>
</root>
</log4j:configuration>
谢谢