为了账号安全,请及时绑定邮箱和手机立即绑定

ibaties如何利用log4j在控制台打印sql?

ibaties如何利用log4j在控制台打印sql?

胡子哥哥 2019-01-16 09:39:46
# Set root logger level to DEBUG and its only appender to CONSOLE. log4j.rootLogger=INFO, CONSOLE,FILE # CONSOLE out information log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout log4j.appender.CONSOLE.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} [%t] %-5p %C{1} : %m%n # file out information log4j.appender.FILE=org.apache.log4j.DailyRollingFileAppender log4j.appender.FILE.File=/home/was/newAgent/newAgent.log log4j.appender.FILE.MaxFileSize=50000KB log4j.appender.FILE.MaxBackupIndex=10 log4j.appender.FILE.layout=org.apache.log4j.PatternLayout log4j.appender.FILE.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} [%t] %-5p %C{1} : %m%n # LIMIT CATEGORIES #log4j.logger.org.jbpm=INFO #log4j.logger.org.jbpm.graph=DEBUG # Hibernate debugging levels and their output #log4j.logger.org.hibernate=INFO # hide optimistic locking failures #log4j.logger.org.hibernate.event.def.AbstractFlushingEventListener=FATAL #Log all SQL DML statements as they are executed #log4j.logger.org.hibernate.SQL=TRACE #Log all JDBC parameters #log4j.logger.org.hibernate.type=TRACE #Log all SQL DDL statements as they are executed #log4j.logger.org.hibernate.tool.hbm2ddl=DEBUG #Log the state of all entities (max 20 entities) associated with the session at flush time #log4j.logger.org.hibernate.pretty=DEBUG #Log all second-level cache activity #log4j.logger.org.hibernate.cache=DEBUG #Log transaction related activity #log4j.logger.org.hibernate.transaction=DEBUG #Log all JDBC resource acquisition #log4j.logger.org.hibernate.jdbc=TRACE #Log HQL and SQL ASTs and other information about query parsing #log4j.logger.org.hibernate.hql.ast=DEBUG #Log all JAAS authorization requests #log4j.logger.org.hibernate.secure=DEBUG #Log everything (a lot of information, but very useful for troubleshooting) #log4j.logger.org.hibernate=DEBUG #log4j.logger.org.hibernate.tools=DEBUG
查看完整描述

2 回答

?
互换的青春

TA贡献1797条经验 获得超6个赞

agent

直接监控 mysql 驱动,不论是ibatis/mybatis/sharingJDBC/jdbc驱动,都直接监控。

查看完整回答
反对 回复 2019-02-12
  • 2 回答
  • 0 关注
  • 457 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信