문제해결
jpa hibernate sql 로그 안보이는 문제 해결
backend dev
2024. 6. 19. 16:23
jpa:
hibernate:
ddl-auto: create
properties:
hibernate:
format_sql: true
logging:
level:
org.hibernate.SQL: debug
org.hibernate.orm.jdbc.bind: trace
jpa:
properties:
hibernate:
show_sql: true
show_sql은 System.out.println 처럼 콘솔출력이므로 사용하지않고
log로 찍는것이 좋다.
logging:
level:
org.hibernate.SQL: debug
이것으로 hibernate가 생성하는 쿼리 로그로 확인가능
org.hibernate.sql 로 적으면 안보인다.
반드시 SQL 대문자로 적을것
또한 sql의 파라미터값을 확인하기 위해서는
org.hibernate.type: trace
가 아니라
org.hibernate.orm.jdbc.bind: trace
를 사용해야한다.
Hibernate ORM User Guide
Starting in 6.0, Hibernate allows to configure the default semantics of List without @OrderColumn via the hibernate.mapping.default_list_semantics setting. To switch to the more natural LIST semantics with an implicit order-column, set the setting to LIST.
docs.jboss.org
org.hibernate.type: trace 작동이 잘 안되는 것 같아요 - 인프런
외부 라이브러리 p6spy 추가 전에 application.yml 에 logging.level.org.hibernate.type: trace 만 추가했을 때 MemberRepositoryTest.java를 실행 시 sql 로그가 안 떠요... - 질문 & 답변 | 인프런
www.inflearn.com