`

动态改变log4j日志级别

阅读更多
在web.xml加入以下配置即可

<!--由Sprng载入Log4j配置文件-->
<context-param>
<param-name>log4jConfigLocation</param-name>
<param-value>classpath:log4j.properties</param-value>
</context-param>

<!--Spring默认刷新Log4j配置文件的间隔,单位为秒-->
<context-param>
<param-name>log4jRefreshInterval</param-name>
<param-value>5000</param-value>
</context-param>

<!--启动监听-->
<listener>
   <listener-class>org.springframework.web.util.Log4jConfigListener</listener-class>
</listener>
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics