Logging SQL queries with Hibernate

I’ve just realized that several visitors landed here searching for this information…

Enabling SQL logging with hibernate only requires to use the property:

hibernate.show_sql = true

(more information on chapter 3 of the manual, table 3.3)

However, some preffer tweaking the log4j configuration (this way, they can choose where to log the SQL). Read the comments to know how to also log the values of the parameters.

Hope I helped.


  • My profile

    View Abel Muño's profile on LinkedIn

    amuino on Twitter

  • My projects

    The cloud market:
    Find the virtual image you need on the cloud.
  • Top Posts

  • Archives

  • Categories

%d bloggers like this: