本文只针对非Maven环境:

1.拷入log4j相关的.jar

  SSM环境集成log4j

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.测试一下

  SSM环境集成log4j

 

相关文章:

  • 2022-02-17
  • 2022-12-23
  • 2021-07-23
  • 2021-07-21
  • 2021-07-02
  • 2021-08-04
  • 2021-08-15
猜你喜欢
  • 2021-08-08
  • 2022-02-17
  • 2021-11-28
  • 2022-12-23
  • 2021-06-20
  • 2021-12-04
  • 2021-09-22
相关资源
相似解决方案