application.yml
spring:
jpa:
properties:
hibernate:
show_sql: true
format_sql: true
use_sql_comments: true
logging:
level:
org:
hibernate:
type:
descriptor:
sql: trace
application.properties
spring.jpa.properties.hibernate.show_sql=true
spring.jpa.properties.hibernate.format_sql=true
spring.jpa.properties.hibernate.use_sql_comments=true
logging.level.org.hibernate.type.descriptor.sql=trace
Hibernate이 DB에 날리는 모든 쿼리(DDL, DML) 표출
application.yml
spring:
jpa:
properties:
hibernate:
show_sql: true
application.properties
spring.jpa.properties.hibernate.show_sql=true
쿼리 들여쓰기 등의 포맷에 맞춰 표출
application.yml
spring:
jpa:
properties:
hibernate:
format_sql: true
application.properties
spring.jpa.properties.hibernate.format_sql=true
application.yml
spring:
jpa:
properties:
hibernate:
use_sql_comments: true
application.properties
spring.jpa.properties.hibernate.use_Sql_comments=true
이 옵션을 사용하지 않으면 기본적으로 파라미터 값이 무엇인지는 알 수 없고, 바인딩 쿼리로그만 찍힌다.
application.yml
logging:
level:
org:
hibernate:
type:
descriptor:
sql: trace
application.properties
logging.level.org.hibernate.type.descriptor.sql=trace