0
如何找到log4j.xml的位置?如何找到log4j,xml的位置?
我需要插入我的log4j.xml的位置,在下面的代码
URL u = getClass().getClassLoader().getResource("");
DOMConfigurator.configure(u);
如何找到log4j.xml的位置?如何找到log4j,xml的位置?
我需要插入我的log4j.xml的位置,在下面的代码
URL u = getClass().getClassLoader().getResource("");
DOMConfigurator.configure(u);
默认情况下,Log4j的查找在classpath中,配置文件命名log4j2.xml(没有的log4j.xml)。
您还可以指定配置文件与此系统属性的完整路径:
-Dlog4j.configurationFile=path/to/log4j2.xml
欲了解更多信息,请点击Log4j