본문 바로가기

서버

Spring boot 3 - application.properties dev,prod,default 설정

728x90

사전에 spring-boot-devtools 라이브러리가 있어야함.

 

1. application-[환경].properties 파일 생성

- application-dev.properties

- application-prod.properties

- application.properties

 

[application.properties]

logging.level.org.springframework=debug

spring.profiles.active=dev

 

[application-dev.properties]

logging.level.org.springframework=debug

 

[application-prod.properties]

logging.level.org.springframework=info

 


application.properties의 

spring.profiles.active가 [환경] 에 맞춰서 override 해준다

 

ex) applcation-[환경].properties