Skip to content

Instantly share code, notes, and snippets.

@zabih-alipour
Last active September 2, 2021 16:21
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zabih-alipour/75628db5001e1c61a7ceb0d96ec6129a to your computer and use it in GitHub Desktop.
Save zabih-alipour/75628db5001e1c61a7ceb0d96ec6129a to your computer and use it in GitHub Desktop.
Log hibernate query statistics and query parameter
############################################# Hibernate query statistics #################################################
### For use in spring boot
spring.jpa.properties.hibernate.generate_statistics=true
### For use in hibernate config
hibernate.generate_statistics=true
### Log parameters
logging.level.org.hibernate.stat=debug
logging.level.org.hibernate.SQL=debug
logging.level.org.hibernate.type.descriptor.sql=trace
############################################# Hibernate query format #################################################
spring.jpa.properties.hibernate.format_sql=true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment