大神指导:spring编程出现log4j的奇怪错误!!
用myeclipse10编写了一个java工程,然后add spring cab..后,用junit进行测试,却出现了错误:
log4j:WARN No appenders could be found for logger (org.springframework.core.env.StandardEnvironment).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
仿佛是spring 3.1.0core library中的log4j-1.2.16.jar没有配置还是什么?网上搜出来的这个错误的信息都是因为web tomcat出错,但是我这里还没涉及到WEB啊,只是一个简单的java project!、
如果要配置求大神说说怎么写配置信息:我这样试过是不行的:
<context-param>
4. <param-name>log4jConfigLocation</param-name>
5. <param-value>/log4j.properties</param-value>
6. </context-param>
7.
8. <context-param>
9. <param-name>log4jRefreshInterval</param-name>
10. <param-value>60000</param-value>
11. </context-param>
12. <listener>
13. <listener-class>
14. org.springframework.web.util.Log4jConfigListener
15. </listener-class>
16. </listener>
17.<!-- end -->
18.
19. <listener>
20. <listener-class>
21. org.springframework.web.context.ContextLoaderListener
22. </listener-class>
23. </listener>