古越剑箫

学习是一种习惯

  :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: :: 管理 ::

 

常用log4j.properties配置文件 

 

log4j.rootLogger = info,console

#指定serviceImpl层 日志输出
log4j.logger.com.sms.service.impl = info,D
log4j.logger.com.sms.aop=info,D
#输出到控制台
log4j.appender.console = org.apache.log4j.ConsoleAppender
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,SSS} method:%l%n%m%n

#输出info文件到D盘
log4j.appender.D = org.apache.log4j.DailyRollingFileAppender
log4j.appender.D.File = d://logs/log.log
log4j.appender.D.Append = true
log4j.appender.D.Threshold = debug 
log4j.appender.D.layout = org.apache.log4j.PatternLayout
log4j.appender.D.layout.ConversionPattern = %-d{yyyy-MM-dd HH:mm:ss}  [ %t:%r ] - [ %p ]  %m%n

#log4j.logger.com.sms.mapper =trace,D
log4j.logger.com.sms.mapper =debug,D

 

posted on 2016-09-23 14:56  古越剑箫  阅读(143)  评论(0编辑  收藏  举报