Spring Boot - Log generated SQL statement and query
To log and see the generated SQL statement and queries in Spring Boot application use the following properties in properties or yaml file. The properties allows to see the SQL from JPA (hibernate), JdbcTemplate (Core JDBC) and Liquibase layers of Spring Boot application. These settings adjust the logging level in logback for various layers in spring boot application.
Using application.properties file
logging.level.org.hibernate=TRACE
logging.level.org.springframework.jdbc=TRACE
logging.level.liquibase=TRACE
Or using application.yml file
logging:
level:
org:
hibernate: TRACE
springframework:
jdbc: TRACE
liquibase: TRACE
Comments
Post a Comment