fly*_*ire 9 java configuration logging
我有一个commons-logging配置问题.
我希望它使用SimpleLog(而不是java.util.logging)并使用level> = debug(而不是info)记录所有消息.
ska*_*man 12
根据commons-logging文档,您应该能够通过使用以下条目SimpleLog将commons-logging.properties文件放在类路径的根目录中来显式配置它以使用它:
org.apache.commons.logging.Log=org.apache.commons.logging.impl.SimpleLog
Run Code Online (Sandbox Code Playgroud)
然后,您可以通过在包含以下内容的类路径根目录中放置一个文件来配置SimpleLog本身simplelog.properties:
org.apache.commons.logging.simplelog.defaultlog=debug
Run Code Online (Sandbox Code Playgroud)
但是,我建议不要这样做.java.util.logging是讨厌的,但它比它更好SimpleLog,而log4j比它们更好.