首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 其他教程 > 开源软件 >

spring集成log4j

2013-02-25 
spring集成log4j .1、 log4j.properties文件1)文件位置:在src下面2)文件配置3、 web.xml配置!--如果不定义w

spring集成log4j .
1、 log4j.properties文件

1)文件位置:在src下面

2)文件配置







3、 web.xml配置

<!--如果不定义webAppRootKey参数,那么webAppRootKey就是缺省的"webapp.root"--> <context-param>  <param-name>webAppRootKey</param-name>  <param-value>ssh.root</param-value> </context-param>这里的ssh是http://localhost:8080/ssh/而root是系统开发目录中ssh/root<!--由Sprng载入的Log4j配置文件位置--> <context-param>  <param-name>log4jConfigLocation</param-name>  <param-value>/WEB-INF/log4j.properties</param-value> </context-param><!--Spring默认刷新Log4j配置文件的间隔,单位为millisecond--> <context-param>  <param-name>log4jRefreshInterval</param-name>  <param-value>60000</param-value> </context-param><!--Spring log4j Config loader--> <listener>  <listener-class>org.springframework.web.util.Log4jConfigListener</listener-class> </listener>

热点排行