log4j.rootLogger=info,console,infolog,errorlog
# console log log4j.appender.console=org.apache.log4j.ConsoleAppender log4j.appender.console.Threshold=all #控制台输出所有日志 log4j.appender.console.layout=org.apache.log4j.PatternLayout log4j.appender.console.layout.ConversionPattern=[%5p]\t%d{YYYY-MM-dd HH\:mm\:ss}\t{%F\:%L}[%t]\t%m%n
# info log file log4j.appender.infolog=org.apache.log4j.DailyRollingFileAppender log4j.appender.infolog.File=log/main.log log4j.appender.infolog.Threshold=info #只输出info及info以上级别的日志 log4j.appender.infolog.Append=true log4j.appender.infolog.Encoding=UTF-8 log4j.appender.infolog.DatePattern='.'yyyy-MM-dd'.log' log4j.appender.infolog.layout=org.apache.log4j.PatternLayout log4j.appender.infolog.layout.ConversionPattern=[%5p]\t%d{YYYY-MM-dd HH\:mm\:ss}\t{%F\:%L}[%t]\t%m%n
# error log file log4j.appender.errorlog=org.apache.log4j.DailyRollingFileAppender log4j.appender.errorlog.File=log/error.log log4j.appender.errorlog.Threshold=error # 只输出error和fatal级别日志 log4j.appender.errorlog.Append=true log4j.appender.errorlog.Encoding=UTF-8 log4j.appender.errorlog.DatePattern='.'yyyy-MM-dd'.log' log4j.appender.errorlog.layout=org.apache.log4j.PatternLayout log4j.appender.errorlog.layout.ConversionPattern=[%5p]\t%d{YYYY-MM-dd HH\:mm\:ss}\t{%F\:%L}[%t]\t%m%n |