首页 > 代码库 > ssh整合log4j
ssh整合log4j
1.web.xml中添加:
<context-param> <param-name>log4jConfigLocation</param-name> <param-value>WEB-INF/classes/log4j.properties</param-value> </context-param> <context-param> <param-name>log4jRefreshInterval</param-name> <param-value>6000</param-value> </context-param> <context-param> <param-name>webAppRootKey</param-name> <param-value>webApp.root</param-value> </context-param> <listener> <listener-class>org.springframework.web.util.Log4jConfigListener</listener-class> </listener>
2.log4j.properties
# Set root logger level to error log4j.rootLogger=INFO, Console, File ###### Console appender definition ####### # All outputs currently set to be a ConsoleAppender. log4j.appender.Console=org.apache.log4j.ConsoleAppender log4j.appender.Console.layout=org.apache.log4j.PatternLayout log4j.appender.Console.layout.ConversionPattern=%-5p [%d{yy.MM.dd HH:mm:ss}][%c]: %m%n ###### File appender definition ####### log4j.appender.File=org.apache.log4j.DailyRollingFileAppender log4j.appender.File.File=${catalina.home}/webapps/项目名称/WEB-INF/logs/log4j.log log4j.appender.File.layout=org.apache.log4j.PatternLayout log4j.appender.File.layout.ConversionPattern=%-5p [%d{yy.MM.dd HH:mm:ss}][%c]: %m%n ##Hibernate log begin## log4j.logger.org.hibernate=info log4j.logger.org.hibernate.SQL=debug log4j.logger.org.hibernate.HQL=debug
ssh整合log4j
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。