개발/Spring

[springboot] 스프링부트에서 실행된 쿼리 로그를 통해 확인하기

lewns2 2021. 3. 12. 17:14

스프링 부트에서는 'application.properties' 파일로 한 줄의 코드를 통한 설정을 지원합니다.

 

  • 방법 : src/main/resources(디렉토리 위치) → Resource Bundle 생성

application.properties

아래와 같은 옵션 추가. 

spring.jpa.show_sql=true

 

  • 기능 : 실행된 쿼리 로그 ON/OFF

실행된 쿼리를 확인 가능

728x90
반응형