1

I'm using Hibernate's EntityManager as a JPA implementation. What I want is logging of the query (HQL or JPA Query Language) made to EntityManager. This is different than SQL logging (which is enabled with the hibernate.show_sql property).

My application issues several queries to Hibernate. I want logging of both the queries issued to Hibernate and the corresponding generated SQL queries. I'd like to achieve this without having to add my own logging just before querying Hibernate.

Does Hibernate support this?

1 Answer 1

1

These are the published logging categories for Hibernate:

http://docs.jboss.org/hibernate/stable/core/reference/en/html/configuration-logging.html

It's not clear which os these would handle HQL logging, so I suggest turning on INFO logging for org.hibernate (i.e. everything), find out which logger does HQL logging, then only use that logger.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.