application.yml

spring:
  datasource:
    url: jdbc:h2:mem:testdb //...1
    username: sa
    password:
    driver-class-name: org.h2.Driver
  h2:
    console:
      enabled: true

  jpa:
    hibernate:
      ddl-auto: create
    properties:
      hibernate:
#        show_sql: true
        format_sql: true

logging:
  level:
    org.hibernate.SQL: debug
#    org.hibernate.type: trace

자세한 설명 참고

  1. jdbc:h2:mem:testdb

    자세히

쿼리 파라미터 로그 남기기

자세한 내용 참고

implementation 'com.github.gavlyukovskiy:p6spy-spring-boot-starter:1.8.0'

쿼리 파라미터 로그 남기기 - 스프링 부트 3.0

스프링 부트 3.0 이상을 사용하면 라이브러리 버전을 1.9.0 이상을 사용해야 합니다.

implementation 'com.github.gavlyukovskiy:p6spy-spring-boot-starter:1.9.0'

Referece