springmvc项目,启动的时候控制台能看到日志,但是后续运行的时候日志没有打印.
尝试解决:
在web.xml中添加
<!-- 配置log4j.xml监听器 -->
<listener>
<listener-class>org.springframework.web.util.Log4jConfigListener</listener-class>
</listener>
<context-param>
<param-name>log4jConfigLocation</param-name>
<param-value>classpath:log4j.properties</param-value>
</context-param>
其中log4j.properties在classpath根目录下