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

Popular posts from this blog

JSON with curl and jq

Import self signed in Linux for Chrome / Chromium headless testing

Colima - Drop In replacement for Docker Desktop for Mac and Linux