我的log4j配置
# base #
log4j.rootLogger=INFO,stdout,D
# change level #
log4j.logger.org.springframework=WARN
log4j.logger.org.hibernate=WARN
log4j.logger.com.alibaba=WARN
# messages--> console #
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.Target=System.out
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern= [%p]%-d{yyyy-MM-dd HH\:mm\:ss} (%F\:%L) %n%m%n
# messages--> file #
log4j.appender.D = org.apache.log4j.DailyRollingFileAppender
log4j.appender.D.File = logs/yesoa.log
log4j.appender.D.Append = true
log4j.appender.D.Threshold = ERROR
log4j.appender.D.layout = org.apache.log4j.PatternLayout
log4j.appender.D.layout.ConversionPattern =[%p]%-d{yyyy-MM-dd HH\:mm\:ss} (%F\:%L) %n%m%n