是的,只需将其添加
log4j.debug到JVM系统变量即可。例如:
java -Dlog4j.debug -cp ... some.class.name
Log4j然后将输出类似以下内容:
log4j: Trying to find [log4j.xml] using context classloader sun.misc.Launcher$AppClassLoader@1f7182c1. log4j: Using URL [file:/C:/Users/matt/workspace/projectname/target/test-classes/log4j.xml] for automatic log4j configuration. log4j: Preferred configurator class: org.apache.log4j.xml.DOMConfigurator log4j: System property is :null log4j: Standard documentBuilderFactory search succeded. log4j: documentBuilderFactory is: org.apache.xerces.jaxp.documentBuilderFactoryImpl log4j: debug attribute= "null". log4j: Ignoring debug attribute. log4j: reset attribute= "false". log4j: Threshold ="null". ...
作为参考,请参见手册和FAQ。



