log4j2怎样配置才能在控制台打印mybatis的sql日志
1个回答
2016-10-31
展开全部
log4j.rootLogger=DEBUG,CONSOLE,FILEOUT
log4j.addivity.org.apache=true
# CONSOLE \u6253\u5370\u5230\u63A7\u5236\u53F0
log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
log4j.appender.Threshold=DEBUG
log4j.appender.CONSOLE.Target=System.out
log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
log4j.appender.CONSOLE.layout.ConversionPattern=[%-5p] %d{yyyy-MM-dd HH\:mm\:ss} \:%m%n
#
# FILEOUT \u6253\u5370\u5230 <span style="font-family: Arial, Helvetica, sans-serif;">D\:\\report.log</span>
log4j.appender.FILEOUT=org.apache.log4j.RollingFileAppender
log4j.appender.FILEOUT.File=D\:\\report.log
log4j.appender.FILEOUT.layout=org.apache.log4j.PatternLayout
log4j.appender.fileout.MaxFileSize=100000KB
log4j.appender.FILEOUT.Append=true
#log4j.appender.CONSOLE.layout.ConversionPattern=[framework] %d \u2013 %c -%-4r [%t] %-5p %c %x \u2013 %m%n
log4j.appender.FILEOUT.layout.ConversionPattern=[%-5p]_%d{yyyy-MM-dd HH\:mm\:ss} \:%m%n
log4j.addivity.org.apache=true
# CONSOLE \u6253\u5370\u5230\u63A7\u5236\u53F0
log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
log4j.appender.Threshold=DEBUG
log4j.appender.CONSOLE.Target=System.out
log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
log4j.appender.CONSOLE.layout.ConversionPattern=[%-5p] %d{yyyy-MM-dd HH\:mm\:ss} \:%m%n
#
# FILEOUT \u6253\u5370\u5230 <span style="font-family: Arial, Helvetica, sans-serif;">D\:\\report.log</span>
log4j.appender.FILEOUT=org.apache.log4j.RollingFileAppender
log4j.appender.FILEOUT.File=D\:\\report.log
log4j.appender.FILEOUT.layout=org.apache.log4j.PatternLayout
log4j.appender.fileout.MaxFileSize=100000KB
log4j.appender.FILEOUT.Append=true
#log4j.appender.CONSOLE.layout.ConversionPattern=[framework] %d \u2013 %c -%-4r [%t] %-5p %c %x \u2013 %m%n
log4j.appender.FILEOUT.layout.ConversionPattern=[%-5p]_%d{yyyy-MM-dd HH\:mm\:ss} \:%m%n
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询