log4j配置

### set log levels ###
log4j.rootLogger = DEBUG , stdout , E , I

### HIBERNATE BEGIN ###
log4j.logger.org.hibernate = ERROR
log4j.logger.org.hibernate.SQL = ERROR
log4j.logger.org.hibernate.HQL = ERROR

### Console ###
log4j.appender.stdout = org.apache.log4j.ConsoleAppender
log4j.appender.stdout.Target = System.out
log4j.appender.stdout.Threshold = DEBUG 
log4j.appender.stdout.layout = org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern =  %-d{yyyy-MM-dd HH:mm:ss} [ %p ] [ %c ] %m%n


### Info Log File ###
log4j.appender.I = org.apache.log4j.DailyRollingFileAppender
log4j.appender.I.File = ${pafa.log.home}/logs/info.log
log4j.appender.I.Append = true
log4j.appender.I.Threshold = INFO 
log4j.appender.I.layout = org.apache.log4j.PatternLayout
log4j.appender.I.layout.ConversionPattern = %-d{yyyy-MM-dd HH:mm:ss} [ %p ] [ %c ] %m%n

### Log File ###
log4j.appender.D = org.apache.log4j.RollingFileAppender
log4j.appender.D.File = ~
log4j.appender.D.Append = true
log4j.appender.D.Threshold = DEBUG 
log4j.appender.D.MaxFileSize= 20000KB
log4j.appender.D.MaxBackupIndex= 3
log4j.appender.D.layout = org.apache.log4j.PatternLayout
log4j.appender.D.layout.ConversionPattern = %-d{yyyy-MM-dd HH:mm:ss} [ %p ] [ %c ] %m%n

###  Error Log file ###
log4j.appender.E = org.apache.log4j.DailyRollingFileAppender
log4j.appender.E.File = ${pafa.log.home}/logs/error.log 
log4j.appender.E.Append = true
log4j.appender.E.Threshold = ERROR 
log4j.appender.E.layout = org.apache.log4j.PatternLayout
log4j.appender.E.layout.ConversionPattern = %-d{yyyy-MM-dd HH:mm:ss} [ %p ] [ %c ] %m%n

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.java.sql.Connection=DEBUG 
log4j.logger.java.sql.Statement=DEBUG 
log4j.logger.java.sql.PreparedStatement=DEBUG

你可能感兴趣的:(log4j配置)