log4j配置文件

/ 默认分类 / 0 条评论 / 874浏览
### 日志级别 ###
log4j.rootLogger = INFO , C , F , E
 
### 控制台 console ###
log4j.appender.C = org.apache.log4j.ConsoleAppender
log4j.appender.C.Target = System.out
log4j.appender.C.layout = org.apache.log4j.PatternLayout
log4j.appender.C.layout.ConversionPattern = [%p] [%-d{yyyy-MM-dd HH🇲🇲ss}] %C.%M(%L) | %m%n
 
### 文件 file ###
log4j.appender.F = org.apache.log4j.DailyRollingFileAppender
log4j.appender.F.File =/home/left/logs/mall/mall_info_log_
log4j.appender.F.File.DatePattern=yyyy-MM-dd'.log' 
log4j.appender.F.Append = true
log4j.appender.F.Threshold = INFO 
log4j.appender.F.layout = org.apache.log4j.PatternLayout
log4j.appender.F.layout.ConversionPattern = [%p] [%-d{yyyy-MM-dd HH🇲🇲ss}] %C.%M(%L) | %m%n
 
### 异常 exception ###
log4j.appender.E = org.apache.log4j.DailyRollingFileAppender
log4j.appender.E.File =/home/left/logs/mall/mall_error_log_
log4j.appender.E.File.DatePattern=yyyy-MM-dd'.log' 
log4j.appender.E.Append = true
log4j.appender.E.Threshold = ERROR 
log4j.appender.E.layout = org.apache.log4j.PatternLayout
log4j.appender.E.layout.ConversionPattern = [%p] [%-d{yyyy-MM-dd HH🇲🇲ss}] %C.%M(%L) | %m%n
 ### JDBC ###
log4j.logger.com.ibatis=DEBUG
log4j.logger.com.ibatis.common.jdbc.SimpleDataSource=DEBUG
log4j.logger.com.ibatis.common.jdbc.ScriptRunner=DEBUG
log4j.logger.com.ibatis.sqlmap.engine.impl.SqlMapClientDelegate=DEBUG
log4j.logger.org.mybatis=DEBUG
### SQL ###
log4j.logger.java.sql.Connection=DEBUG
log4j.logger.java.sql.Statement=DEBUG
log4j.logger.java.sql.PreparedStatement=DEBUG
log4j.logger.java.sql.ResultSet=DEBUG
 
# 输出special日志
log4j.logger.special = INFO, special
# 是否在父log中输出日志
log4j.additivity.special = false
# 每天生产日志文件
log4j.appender.special = org.apache.log4j.DailyRollingFileAppender
# 生成日志到单独的文件
log4j.appender.special.File =/home/left/logs/mall/special/special_
log4j.appender.special.File.DatePattern=yyyy-MM-dd'.log' 
# 追加日志
log4j.appender.special.Append = true
# 日志级别
log4j.appender.special.Threshold = INFO
log4j.appender.special.layout = org.apache.log4j.PatternLayout
# 日志格式
log4j.appender.special.layout.ConversionPattern = [%p] [%-d{yyyy-MM-dd HH🇲🇲ss}] %C.%M(%L) | %m%n