<!-- 指定log4j配置文件log4j.properties的位置(如果是在classpath根路径下,可以不配置) -->
<context-param>
<param-name>log4jConfiguration</param-name>
<param-value>classpath:others/log4j.properties</param-value>
</context-param>
<!-- 配置spring中对于log4j的listener,注意该Listener要在spring的listener之前 -->
<listener>
<listener-class>org.springframework.web.util.Log4jConfigListener</listener-class>
</listener>
转载于:https://my.oschina.net/lemos/blog/793992