The logger includes parameters and can be filtered per package; show-sql just prints to stdout.
// application.yml
logging:
level:
org.hibernate.SQL: DEBUG
org.hibernate.orm.jdbc.bind: TRACE # parameter values (Hibernate 6)
# Rather than:
spring.jpa.show-sql: true
DEBUG org.hibernate.SQL - select o1_0.id ... from orders o1_0 where o1_0.status=?
TRACE binding parameter (1:VARCHAR) <- [PLACED]
Run this yourself in the Online Java Compiler, spin up a live REST API in the API Sandbox, or practise with Java interview questions.
Published 2026-08-11