hibernate查询显示参数

log4j.property改为如下

### direct log messages to stdout ###  
        log4j.appender.stdout=org.apache.log4j.ConsoleAppender  
        log4j.appender.stdout.Target=System.out  
        log4j.appender.stdout.layout=org.apache.log4j.PatternLayout  
        log4j.appender.stdout.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n  
          
        log4j.logger.org.hibernate=debug
        log4j.logger.org.hibernate.hql.ast.AST=debug
        
        #下面的两条配置非常重要,设置为trace后,将可以看到打印出sql中 ? 占位符的实际内容
        #this is the most important config for showing parames like ?
        log4j.logger.org.hibernate.SQL=trace
        log4j.logger.org.hibernate.type=trace
        #above two configs
        log4j.logger.org.hibernate.tool.hbm2ddl=debug
        log4j.logger.org.hibernate.hql=debug
        log4j.logger.org.hibernate.cache=debug


        log4j.logger.org.hibernate.transaction=debug
        log4j.logger.org.hibernate.jdbc=debug
        log4j.logger.org.hibernate.connection.DriverManagerConnectionProvider=trace

          
        log4j.rootLogger=warn, stdout  
        log4j.logger.org.hibernate.type.descriptor.sql.BasicBinder=TRACE

posted @ 2015-03-16 15:40  Java_Code  阅读(544)  评论(0编辑  收藏  举报