我試圖將我的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