Log4j.properties 在类路径上但未加载
Log4j.properties on classpath but not loaded
我正在使用 maven 和 one-jar 插件构建我的项目,我的 log4j.properties
在 src/main/resources
中。我已经使用 one-jar.verbose
来检查类路径中是否存在,并且同一目录中的其他属性文件是否已被程序成功使用。但是,当我 运行 它时,我仍然收到以下错误:
log4j:WARN No appenders could be found for logger (org.springframework.test.context.junit4.SpringJUnit4ClassRunner).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
使用 BasicConfigurator.configure()
是一种快速解决方法,但我需要它位于外部配置文件中。
有什么想法吗?
我在 log4j.properties
中配置的 appender,我没有添加到 log4j.rootLogger=...
我正在使用 maven 和 one-jar 插件构建我的项目,我的 log4j.properties
在 src/main/resources
中。我已经使用 one-jar.verbose
来检查类路径中是否存在,并且同一目录中的其他属性文件是否已被程序成功使用。但是,当我 运行 它时,我仍然收到以下错误:
log4j:WARN No appenders could be found for logger (org.springframework.test.context.junit4.SpringJUnit4ClassRunner).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
使用 BasicConfigurator.configure()
是一种快速解决方法,但我需要它位于外部配置文件中。
有什么想法吗?
我在 log4j.properties
中配置的 appender,我没有添加到 log4j.rootLogger=...