티스토리 뷰
728x90
반응형
Spring Boot Logging Level 설정
# application.yml
logging:
level:
com.snailvoyager.<packageName>.<className>: DEBUG
Feign Logging Level 설정
Java 설정 방법과 yml 설정 방법 두가지가 있다.
두가지 모두 설정하게 되면 application.yml 설정으로 적용된다.
A. Java Configuration
public class FeignConfig {
@Bean
Logger.Level feignLoggerLevel() {
return Logger.Level.FULL;
}
}
// configuration 속성으로 Config class 바인딩
@FeignClient(name = "foo-client", configuration = FeignConfig.class)
public interface FooClient {
// methods for different requests
}
B. application.yml
feign:
client:
config:
default:
loggerLevel: full
# feign client name 별로 설정 가능
feign:
client:
config:
foo-client:
loggerLevel: full
# spring cloud 2022 버전 이후 부터
spring:
cloud:
openfeign:
client:
config:
default:
logger-level: full
Intellij Community 버전 Feign 로그 안나오는 이슈
application.yaml 에 logging.level.root: debug 설정을 해도 로그가 안나오면
application.yaml -> application.yml 파일로 변경하면 Feign 로그가 나온다.
Spring Boot 에서는 yaml, yml 구분없이 사용 가능하고, Intellij Ultimate에서는 문제 없지만
IntelliJ Community 에서는 이슈 발생
https://docs.spring.io/spring-cloud-openfeign/docs/current/reference/html/#feign-logging
https://www.baeldung.com/java-feign-logging
728x90
반응형
'Spring' 카테고리의 다른 글
[Spring Boot] OpenFeign Fallback (0) | 2023.10.03 |
---|---|
[Spring Boot] WireMock API 테스트 (0) | 2023.10.03 |
[Spring Boot] OpenFeign (0) | 2023.09.28 |
[Spring] @SpringBootTest 통합테스트 (0) | 2023.08.27 |
[Spring] MockMvc 사용 시 403 Forbidden 에러 발생 (0) | 2023.08.27 |
반응형
300x250