Print the execution statement of mybatis to the console and file

log4j.rootLogger=INFO,CONSOLE,fileout

#CONSOLE

log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender

log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout

log4j.appender.CONSOLE.layout.ConversionPattern=%d %p [%c] - %m%n

#Add the following sentence, indicating that only info-level information will be received by CONSOLE

#log4j.appender.CONSOLE.Threshold=INFO

 

#OutFile

log4j.appender.fileout=org.apache.log4j.DailyRollingFileAppender

log4j.appender.fileout.layout=org.apache.log4j.PatternLayout

log4j.appender.fileout.layout.ConversionPattern=[%d]%m%n

#The corresponding file will be generated in the root directory where the workspace is located

log4j.appender.fileout.File=/myself_pjt/office_web.log

log4j.appender.fileout.DatePattern='_'yyyy-MM-dd'.log'

 

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

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326223847&siteId=291194637