【发布时间】:2010-11-24 22:05:48
【问题描述】:
我有一个公共日志记录配置问题。
我希望它使用 SimpleLog(而不是 java.util.logging)并记录所有级别 >= debug(而不是 info)的消息。
【问题讨论】:
标签: java configuration logging
我有一个公共日志记录配置问题。
我希望它使用 SimpleLog(而不是 java.util.logging)并记录所有级别 >= debug(而不是 info)的消息。
【问题讨论】:
标签: java configuration logging
根据commons-logging docs,您应该能够通过将commons-logging.properties 文件放在类路径的根目录中并使用以下条目来显式配置它以使用SimpleLog:
org.apache.commons.logging.Log=org.apache.commons.logging.impl.SimpleLog
然后,您可以通过在包含以下内容的类路径根目录中放置 simplelog.properties 文件来 configure SimpleLog itself:
org.apache.commons.logging.simplelog.defaultlog=debug
但是,我建议不要这样做。 java.util.logging 很讨厌,但是比SimpleLog 好,log4j 比他们都好。
【讨论】: