WARN No appenders could be found for logger (org.springframework.web.context.ContextLoader).
程序员文章站
2024-01-01 22:55:04
...
错误现象:
每次启动Tomcat6.0总会出现如下提示,但不影响Tomcat正常运行。提示如下:
log4j:WARN No appenders could be found for logger (org.springframework.web.context.ContextLoader).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
问题原因:
之前是通过设置Servlet自启动来初始化Log4j的配置,因此可能与后面采用的Spring不兼容。
原配置如下:
解决方法:
使用org.springframework.web.util.Log4jConfigListener配置代替自定义的InitServlet来初始化Log4j,即删除InitServlet配置
注意:要严格按照以上配置顺序。
推荐阅读
-
WARN No appenders could be found for logger (org.springframework.web.context.ContextLoader).
-
No handlers could found for logger "flask_migrate"错误
-
关于运行ssm环境maven插件tomcat时出现的log4j:WARN No appenders could be found for logger
-
C3P0 log4j:WARN No appenders could be found for logger (com.mchange.v2.log.MLog)
-
C3P0 log4j:WARN No appenders could be found for logger (com.mchange.v2.log.MLog)
-
java API操作HDFS出现log4j:WARN No appenders could be found.............
-
mxnet使用mxboard可视化模型权重参数报错:No handlers could be found for logger “mxboard.event_file_writer“
-
log4j:WARN No appenders could be found for logger
-
log4j:WARN No appenders could be found for logger
-
关于运行ssm环境maven插件tomcat时出现的log4j:WARN No appenders could be found for logger