当前位置: 代码迷 >> 综合 >> 解决:WARN No appenders could be found for logger (org.springframework.web.context.ContextLoader).
  详细解决方案

解决:WARN No appenders could be found for logger (org.springframework.web.context.ContextLoader).

热度:30   发布时间:2024-01-30 04:22:13.0

springMVC在启动tomcat出现警告信息:

log4j:WARN No appenders could be found for logger (org.springframework.web.context.ContextLoader).
log4j:WARN Please initialize the log4j system properly.

解决方法:在web.xml中将Spring配置文件信息放在日志配置下面即可

	<!-- 日志配置 --><context-param><param-name>log4jConfigLocation</param-name><param-value>classpath:config/log4j.properties</param-value></context-param><listener><listener-class>org.springframework.web.util.Log4jConfigListener</listener-class></listener><!-- Spring配置文件信息 --><context-param><param-name>contextConfigLocation</param-name><param-value>classpath:config/spring/applicationContext.xml</param-value></context-param><!-- ContextLoaderListener监听器 --><listener><listener-class>org.springframework.web.context.ContextLoaderListener</listener-class></listener>
  相关解决方案