环境:SPRING-TEST ,JUNIT,Log4j
运行 junit时,报错
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.
SLF4J: Class path contains multiple SLF4J bindings.
而且,程序中声明的logger.debug info啥的全都不输出,即使跑在web容器中也不生效,
只需将log4j.properties放到src目录下,重新编译,即可。在容器中,junit中,均能输出log信息了