我试图将我的log4j.properties转换为log4j.xml,因为我需要使用一些过滤器功能。我得到了一堆警告,当我启动应用程序,我不完全知道如何解决这些问题:使用log4j.xml时的log4j警告消息
log4j:WARN Continuable parsing error 4 and column 69
log4j:WARN Attribute "threshold" for element type "log4j:configuration" has a default value and must be specified in a standalone document.
log4j:WARN Continuable parsing error 4 and column 69
log4j:WARN Attribute "debug" for element type "log4j:configuration" has a default value and must be specified in a standalone document.
log4j:WARN Continuable parsing error 4 and column 69
log4j:WARN Attribute "reset" for element type "log4j:configuration" has a default value and must be specified in a standalone document.
log4j:WARN Continuable parsing error 20 and column 23
log4j:WARN The content of element type "log4j:configuration" must match "(renderer*,appender*,plugin*,(category|logger)*,root?,(categoryFactory|loggerFactory)?)".
log4j:WARN Unrecognized element param
我只是一个非常简单的log4j.xml文件试图还有:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
<appender name="A1" class="org.apache.log4j.ConsoleAppender">
<param name="Threshold" value="INFO"/>
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%-5p | %d{MM-dd-yyyy HH:mm:ss.SSS} | %t | %c(%L) - %m%n"/>
</layout>
</appender>
<root>
<priority value="INFO"/>
<appender-ref ref="A1"/>
</root>
</log4j:configuration>
有什么我错过了吗?谢谢!
它似乎从顶部取出standalone =“yes”属性来解决问题。那么我的问题是,这个独立属性究竟做了什么? – fei 2010-06-22 22:31:36