Spring Boot/Hibernate
Hibernate 쿼리 로그, 라인 맞추고 색깔로 구분하기
제뉴어리맨
2022. 9. 2. 13:26
- application.yml 파일의 내용
spring:
h2:
console:
enabled: true
path: /h2
datasource:
url: jdbc:h2:mem:test
jpa:
hibernate:
ddl-auto: create # (1) 스키마 자동 생성 , create, update, create-drop, validate none
show-sql: true # (2) SQL 쿼리 출력
properties:
hibernate:
format_sql: true
highlight_sql: true
위 내용은 전체 내용이다.
실질적으로 hibernate에서 날리는 쿼리를 콘솔에서
들여쓰기를 해주고 색깔을 구분지어 주는 부분은 아래의 내용이다.
properties:
hibernate:
format_sql: true
highlight_sql: true