인프런 커뮤니티 질문&답변
properties와 yaml 질문
작성
·
638
0
application.properties로 하면 오류가 뜨고 application.yaml로 하면 문제가 해결이 됩니다.. 뭐가 문제인지 모르겠습니다.
spring.output.ansi.enabled=always
# DB 설정
spring.datasource.url=jdbc:h2:tcp://localhost/~/capstone
spring.datasource.username=sa
spring.datasource.password=
spring.datasource.driver-class-name=org.h2.Driver
# JPA 관련
spring.jpa.hibernate.ddl-auto=create-drop      #애플리케이션을 시작할 때 데이터베이스를 초기화하고 다시 테이블 생성
# ddl-auto=none로 하면 데이터 보존
spring.jpa.properties.hibernate.format_sql=true #실행되는 query를 보여준다.
# JPA Log -> SQL  로거를 통해 출력, 바인딩 되는 파라미터 확인 2가지 가능하도록
logging.level.org.hibernate.SQL=DEBUG
logging.level.org.hibernate.type.descriptor.sql.BasicBinder=TRACE
# JPA Log
#spring.jpa.show-sql=true system.out은 안되야 하므로 이건 X
위가 application.properties이고
logging:
    level:
        org:
            hibernate:
                SQL: DEBUG
                type:
                    descriptor:
                        sql:
                            BasicBinder: TRACE
spring:
    datasource:
        driver-class-name: org.h2.Driver
        password:
        url: jdbc:h2:tcp://localhost/~/capstone
        username: sa
    jpa:
        hibernate:
            ddl-auto: create-drop      #??????? ??? ? ??????? ????? ?? ??? ??'
        properties:
            hibernate:
                format_sql: true #???? query? ????.'
    output:
        ansi:
            enabled: always위가 application.yaml로 실행했을 때 입니다.
어째서 yaml로 해야만 실행되는지 모르겠습니다. 모든 설정은 같은거 같은데 혹시 부트 3.0이라 그런 것인지 궁금합니다.





