下面是我的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="consoleAppender" class="org.apache.log4j.ConsoleAppender">
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%d
%-5p [%c{1}] %m %n" />
</layout>
</appender>
<appender name="fileAppender" class="org.apache.log4j.RollingFileAppender">
<param name="File" value="${myWebapp-instance-root}/WEB-INF/logs/application.log" />
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%d
%-5p [%c{1}] %m %n" />
</layout>
</appender>
<root>
<priority value="INFO"></priority>
<appender-ref ref="consoleAppender" />
<appender-ref ref="fileAppender" />
</root>
</log4j:configuration>