#h2 console 활성화 및 경로 설정
spring.h2.console.enabled=true
spring.h2.console.path=/h2-console
#h2 db 설정
spring.datasource.url=jdbc:h2:~/test;
spring.datasource.driverClassName=org.h2.Driver
spring.datasource.username=sa
spring.datasource.password=
spring.jpa.database-platform=org.hibernate.dialect.H2Dialect
spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.H2Dialect
#hibernate 설정
spring.jpa.properties.hibernate.format_sql=true
#spring.jpa.properties.hibernate.show_sql=true
spring.jpa.hibernate.ddl-auto=create
logging.level.org.hibernate.SQL= DEBUG
# h2에 일일이 가지 않고도 로그로 변화값 확인
logging.level.org.hibernate.type.descriptor.sql= trace
아래의 코드로 properties를 설정하면 h2 콘솔에 일일이 들어가지 않고도 내가 원하는 값이 인서트됐는지 콘솔창에서 볼수 있다
# h2에 일일이 가지 않고도 로그로 변화값 확인
logging.level.org.hibernate.type.descriptor.sql= trace
스프링 properties 기본 세팅
properties 기본 세팅
아래의 코드로 properties를 설정하면 h2 콘솔에 일일이 들어가지 않고도 내가 원하는 값이 인서트됐는지 콘솔창에서 볼수 있다
yml로 변경하고 싶으면 http://mageddo.com/tools/yaml-converter 이런 사이트에서 컨버터해서 쓰면 된당!
사람의 욕심은 끝이 없으니, 그냥 Values 값에 나오게 할 수 없나 ?
라이브러리를 사용하자(P6Spy)
https://github.com/gavlyukovskiy/spring-boot-data-source-decorator
GitHub - gavlyukovskiy/spring-boot-data-source-decorator: Spring Boot integration with p6spy, datasource-proxy, flexy-pool and s
Spring Boot integration with p6spy, datasource-proxy, flexy-pool and spring-cloud-sleuth - GitHub - gavlyukovskiy/spring-boot-data-source-decorator: Spring Boot integration with p6spy, datasource-p...
github.com
빨간색 브이자 : 데이터 인서트 전
노란색 브이자 : 데이터 인서트 후 값 변화 콘솔창에서 확인 가능!