반응형
Spring Boot 기반 autoconfigure 환경을 제공하는 프로젝트 경우 테스트 코드 작성 시 Spring이 제공하는 ApplicationContextRunner , WebApplicationContextRunner , ReactiveWebApplicationContextRunner 를 사용하여 작성하게 된다.
예전엔 ApplicationContextRunner 또는 WebApplicationContextRunner 사용 시 debug=true 옵션을 추가하면 boot 관련 로그를 확인할 수 있었다.
버전이 올라가면서 로그를 확인하는 방식이 바뀌었고 기존 코드의 runner 실행 시 로그가 보이지 않게 되었다.
아래처럼 initializer로 ConditionEvaluationReportLoggingListener 를 등록해 주면 기존처럼 로그가 보이게 된다.
ApplicationContextRunner contextRunner = new ApplicationContextRunner()
.withInitializer(ConditionEvaluationReportLoggingListener.forLogLevel(LogLevel.INFO))반응형
'Study > Java' 카테고리의 다른 글
| Spring Boot ConfigurationMetaData 사용해 보기 (0) | 2025.03.28 |
|---|---|
| JDK 24 New Features (0) | 2025.03.26 |
| Copilot4Eclipse 사용해 보기 (0) | 2025.01.28 |
| Window 개발 환경에서 https로 Spring Boot Application 개발하기 (1) | 2025.01.04 |
| Mybatis에서 custom MapTypeHandler 사용해 보기 (0) | 2024.12.29 |
| Spring Boot 3.4 Release Notes (0) | 2024.12.03 |
| hibernate SqlType.JSON (json data) 사용해 보기 (0) | 2024.11.18 |
| Spring Cloud Context의 @RefreshScope를 사용하여 properties 설정 갱신하기 (0) | 2024.11.17 |
| springdoc swagger ui에 authorize 사용해 보기 (0) | 2024.11.07 |
| JDK 23 New Features (0) | 2024.10.07 |