Show Hibernate/JPA SQL Statements from Spring Boot | Code Factory

1. Overview

2. Logging JPA Queries

2.1. To Standard Output

spring.jpa.show-sql=true
spring.jpa.properties.hibernate.format_sql=true

2.2. Via Loggers

logging.level.org.hibernate.SQL=DEBUG
logging.level.org.hibernate.type.descriptor.sql.BasicBinder=TRACE

3. Logging JdbcTemplate Queries

logging.level.org.springframework.jdbc.core.JdbcTemplate=DEBUG
logging.level.org.springframework.jdbc.core.StatementCreatorUtils=TRACE

4. How Does it Work?

--

--

--

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Reading Files in Python

How to secure your EC2 instances replacing SSH

Is Backend-as-a-Service(BaaS) a right choice for your app development plan?

Paperfly Courier Integration for Laravel Framework

Functional Currying

How to display X11 windows on your local machine while remotely debugging in VSCode

The books will change in the Near future (My first steps in Near Protocol)

Why does Big Tech move fast?

Move Fast and Break Things Poster | Source: https://www.facebook.com/education/photos/this-poster-found-on-the-walls-of-facebook-offices-around-the-globe-says-move-fa/10155896703835272/

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Code Factory

Code Factory

More from Medium

Spring — Never Rollback Readonly Transactions

Auto-configuration with Spring Boot

Communication Between Microservices | Spring WebClient

Reactive programming: principles, standards, implementation in Java