log4j:WARN No appenders could be found for logger

Log4j错误:

log4j:WARN No appenders could be found for logger (org.springframework.web.client.RestTemplate).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.

解决办法:

(1)检查Web项目中web.xml配置位置,log4j Listener必须在contextLoaderListener之前;

(2)将log4j.properties文件复制到/WEB-INF/classes目录下即可;

相关推荐