我希望禁用由org.springframework.*等内容生成的控制台日志记录消息。我的log4j.xml文件如下所示:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE log4j:configuration PUBLIC
"-//APACHE//DTD LOG4J 1.2//EN"
"http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/xml/doc-files/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>
<logger name="org.springframework">
<level value="off" />
</logger>
<logger name="com.myapp">
<level value="all" />
<appender-ref ref="consoleAppender"/>
</logger>
</log4j:configuration>
但它并没有起作用,我仍然在控制台上看到许多由org.springframework产生的DEBUG、INFO信息。
我应该改变什么来使它起作用?