
# 日志级别：DEBUG < INFO < WARN < ERROR < FATAL.
log4j.rootLogger=DEBUG,CONSOLE,FILE,
log4j.addivity.org.apache=true

# 应用于控制台
log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
log4j.appender.CONSOLE.Threshold=ERROR
log4j.appender.CONSOLE.Target=System.out
log4j.appender.CONSOLE.Encoding=GBK
log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
log4j.appender.CONSOLE.layout.ConversionPattern=%d %5p [%c] - %m%n
#log4j.appender.CONSOLE.layout.ConversionPattern=[SP] %d - %c -%-4r [%t] %-5p %x - %m%n

# 每天新建日志
log4j.appender.A1=org.apache.log4j.DailyRollingFileAppender
log4j.appender.A1.File=${catalina.home}/logs/daily.log
log4j.appender.A1.Append=true
log4j.appender.A1.Encoding=GBK
log4j.appender.A1.Threshold=ERROR
log4j.appender.A1.DatePattern='.'yyyy-MM-dd
log4j.appender.A1.layout=org.apache.log4j.PatternLayout
log4j.appender.A1.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L : %m%n

# 应用于文件
log4j.appender.FILE=org.apache.log4j.FileAppender
log4j.appender.FILE.File=${catalina.home}/logs/server.log
log4j.appender.FILE.Append=true
log4j.appender.FILE.Encoding=GBK
log4j.appender.FILE.Threshold=INFO
log4j.appender.FILE.layout=org.apache.log4j.PatternLayout
log4j.appender.FILE.layout.ConversionPattern=%d - %c(%F:%L) -%-4r [%t] %-5p - %m%n


# 应用于文件回滚
log4j.appender.ROLLING_FILE=org.apache.log4j.RollingFileAppender
log4j.appender.ROLLING_FILE.Threshold=ERROR
log4j.appender.ROLLING_FILE.File=${catalina.home}/logs/server.log
log4j.appender.ROLLING_FILE.Append=true
log4j.appender.CONSOLE_FILE.Encoding=GBK
log4j.appender.ROLLING_FILE.MaxFileSize=5MB
log4j.appender.ROLLING_FILE.MaxBackupIndex=1
log4j.appender.ROLLING_FILE.layout=org.apache.log4j.PatternLayout
log4j.appender.ROLLING_FILE.layout.ConversionPattern=[suppermap] %d - %c -%-4r [%t] %-5p %x - %m%n

# SQL语句
log4j.logger.org.apache.ibatis=DEBUG, sql
log4j.logger.org.mybatis=DEBUG, sql
log4j.logger.java.sql.Connection=DEBUG, sql
log4j.logger.java.sql.Statement=DEBUG, sql
log4j.logger.java.sql.PreparedStatement=DEBUG, sql

# appender sql 
log4j.appender.sql=org.apache.log4j.RollingFileAppender
log4j.appender.sql.File = ${catalina.home}/logs/sql.log
log4j.appender.sql.MaxFileSize = 4096KB
log4j.appender.sql.MaxBackupIndex=20
log4j.appender.sql.layout=org.apache.log4j.PatternLayout
log4j.appender.sql.layout.ConversionPattern=%d %p [%c] - %m%n
