log4j配置

log4j.rootLogger=DEBUG,myConsole,myLogFile
#console appender
log4j.appender.console=org.apache.log4j.ConsoleAppender
log4j.appender.console.layout=org.apache.log4j.PatternLayout
log4j.appender.console.layout.ConversionPattern=%5p [%t] (%F:%L) -%m%n
log4j.appender.console.threshold=ERROR

#rolling file appender
log4j.appender.logfile=org.apache.log4j.FileAppender
log4j.appender.logfile.File=${webappHome}/WEB-INf/log/mylog.log
log4j.appender.logfile.MaxBackupIndex=1
log4j.appender.logfile.layout=org.apache.log4j.PatternLayout
log4j.appender.logfile.layout.ConversionPattern=%d{mmm d,yyyy hh:mm:ss a} : %p [%t] %m%n
log4j.appender.logfile.threshold=ERROR

#myibatis CRUD console
log4j.logger.com.ibatis=debug
log4j.logger.java.sql.Statement=DEBUG
log4j.logger.java.sql.PreparedStatement=DEBUG




.

你可能感兴趣的:(sql,log4j,ibatis)