Execute test class in dev or prod profile to get different detail levels of log information for a spring boot application using logback.
Java 11
H2 Database Engine
spring boot
spring data jpa
hibernate
logback
maven
junit
1-) Package spring boot application with dev profile to get detailed log during packaging
D:\DEV\spring-boot-logback-profile-based-config> mvnw.cmd clean package -Dspring.profiles.active=dev
DEBUG [main] org.springframework.boot.StartupInfoLogger: Running with Spring Boot v2.4.4, Spring v5.3.5
INFO [main] org.springframework.boot.SpringApplication: The following profiles are active: dev
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
2-) Package spring boot application with prod profile to get info level, limited log during packaging
D:\DEV\spring-boot-logback-profile-based-config> mvnw.cmd clean package -Dspring.profiles.active=prod
INFO [main] org.springframework.boot.SpringApplication: The following profiles are active: prod
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------