在web项目中配置log4j

在web.xml中添加如下代码

1 <context-param>
2     <param-name>contextConfigLocation</param-name>
3     <param-value>classpath*:*.xml</param-value>
4 </context-param>
5  
6 <listener>
7     <listener-class>org.springframework.web.util.Log4jConfigListener</listener-class>
8 </listener>
原文地址:https://www.cnblogs.com/modprobe/p/4302649.html