logj.properties 配置文件内容

logj.properties 配置文件内容

### set log levels ###
 log4j.rootLogger = DEBUG , C , D , E 

 ### console ###
 log4j.appender.C = org.apache.log4j.ConsoleAppender
 log4j.appender.C.Target = System.out
 log4j.appender.C.layout = org.apache.log4j.PatternLayout
 log4j.appender.C.layout.ConversionPattern = [mybatis_study][%p] [%-d{yyyy-MM-dd HH\:mm\:ss}] %C.%M(%L) | %m%n

 ### log file ###
 log4j.appender.D = org.apache.log4j.DailyRollingFileAppender
 log4j.appender.D.File = ../logs/mybatis_study.log
 log4j.appender.D.Append = true
 log4j.appender.D.Threshold = INFO 
 log4j.appender.D.layout = org.apache.log4j.PatternLayout
 log4j.appender.D.layout.ConversionPattern = [mybatis_study][%p] [%-d{yyyy-MM-dd HH\:mm\:ss}] %C.%M(%L) | %m%n

 ### exception ###
 log4j.appender.E = org.apache.log4j.DailyRollingFileAppender
 log4j.appender.E.File = ../logs/mybatis_study_error.log 
 log4j.appender.E.Append = true
 log4j.appender.E.Threshold = ERROR 
 log4j.appender.E.layout = org.apache.log4j.PatternLayout
 log4j.appender.E.layout.ConversionPattern = [mybatis_study][%p] [%-d{yyyy-MM-dd HH\:mm\:ss}] %C.%M(%L) | %m%n

 ###mybatis show sql###
 log4j.logger.com.ibatis=debug
 log4j.logger.com.ibatis.common.jdbc.SimpleDataSource=debug
 log4j.logger.com.ibatis.common.jdbc.ScriptRunner=debug
 log4j.logger.com.ibatis.sqlmap.engine.impl.SqlMapClientDelegate=debug

 log4j.logger.java.sql.Connection=debug
 log4j.logger.java.sql.Statement=debug
 log4j.logger.java.sql.PreparedStatement=debug

 

posted @ 2019-08-27 15:18  Courage.Kiven  阅读(793)  评论(0编辑  收藏  举报