我正在使用apache commons库和log4j。 我有一个xml配置文件和一个log4j.properties文件。我想在我的xml配置文件中指定我的log4j属性路径。 要载入我的设置我做:log4j警告问题 - apache commons
//Loading my xml file
this.config = new XMLConfiguration(this.xmlFileName);
这时下面的警告提出:
log4j:WARN No appenders could be found for logger (org.apache.commons.configuration.ConfigurationUtils).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
但是我还没有叫任何log4j的对象。一旦我阅读了XML文件,我可以成功地使用我的log4j实例。 有什么方法可以删除这些警告?
好的,有没有什么办法可以在'org.apache.commons.configuration.ConfigurationUtils'中禁用LOG,或者配置我的xml配置的log4j属性? – PapaSmurf 2012-04-03 13:11:50