SSM环境集成log4j

本文只针对非Maven环境:

1.拷入log4j相关的.jar

  

2.在web.xml中配置

  

<!--由Spring载入的Log4j配置文件位置-->
    <context-param>
       <param-name>log4jConfigLocation</param-name>
       <param-value>classpath:log4j.properties</param-value>
    </context-param>
<!--Spring log4j Config loader-->
    <listener>
       <listener-class>
           org.springframework.web.util.Log4jConfigListener
       </listener-class>
    </listener>

3.测试一下

  

 

posted @ 2018-10-18 23:13  Joey44  阅读(1292)  评论(0编辑  收藏  举报
BACK TO TOP