欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

log4j:WARN No appenders could be found for logger

程序员文章站 2022-05-23 22:13:44
...

 

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目录下即可;