P E N C I L
Login

Log SQL Hibernate

  1. log4j.properties
    1. http://stackoverflow.com/questions/2536829/hibernate-show-real-sql
      #Show transaction
      #log4j.logger.org.springframework.aop=DEBUG
      #log4j.logger.org.springframework.orm=DEBUG
      #log4j.logger.org.springframework.transaction=DEBUG
      #log4j.logger.org.hibernate.transaction=DEBUG

      # Show hibernate SQL
      #log4j.logger.org.hibernate.SQL=DEBUG
      #log4j.logger.org.hibernate.hql=DEBUG

  2. Debug log samples
    1. log4j.logger.org.springframework.orm.hibernate3.HibernateTransactionManager=DEBUG
      1. [HibernateTransactionManager] - Initiating transaction commit
      2. [HibernateTransactionManager] - Committing Hibernate transaction on Session [org.hibernate.impl.SessionImpl@b4fdfd7]