将我的war文件部署到tomcat时出现错误:
log4j:WARN The content of element type "log4j:configuration" must match "(renderer*,throwableRenderer?,appender*,plugin*,(category|logger)*,root?,(categoryFactory|loggerFactory)?)"
我四处搜寻,发现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="console" class="org.apache.log4j.ConsoleAppender"> <param name="Target" value="System.out"/> <layout class="org.apache.log4j.PatternLayout"> <param name="ConversionPattern" value="%-5p %d %c %x - %m%n"/> </layout> </appender> <root> <priority value ="error" /> <appender-ref ref="console" /> </root> <category name="org.springframework" additivity="false"> <priority value="info" /> <appender-ref ref="console" /> </category> </log4j:configuration>
有什么建议么?
根据错误消息,DTD期望所有category元素都在该root元素之前。您选择的方式错误。
category
root