Web/Spring
[Spring-boot JPA] JPA Hibernate Log 정렬해서 보여주기
EricJeong
2019. 9. 6. 11:01
application.properties파일에 다음 속성을 추가해주세요.
spring.jpa.show-sql=true spring.jpa.properties.hibernate.format_sql=true |
show-sql 속성은 sql쿼리문을 보여주도록 true로 설정해주세요.
spring.jpa.properties.hibernate.format_sql 속성은 코드센스에 잘 안보입니다. 직접 적어주세요.
이 속성은 sql query 로그가 한줄로 나오지 않고 정렬해서 나오도록 보여줍니다.
위 속성들을 적용한 걸과는 다음과 같이 정렬되어 보입니다.