验证中...
Languages: Java
Categories: Web开发技术
Latest update 2019-11-12 19:13
使用Java代码方式配置Feign日志级别
Raw Copy
package com.inedible.contentcenter;
import feign.Logger;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.Bean;
import org.springframework.web.client.RestTemplate;
@SpringBootApplication
@EnableDiscoveryClient
@EnableFeignClients(defaultConfiguration = FeignConfiguration.class)
public class ContentCenterApplication {
public static void main(String[] args) {
SpringApplication.run(ContentCenterApplication.class, args);
}
}
class FeignConfiguration {
@Bean
public Logger.Level level(){
return Logger.Level.FULL;
}
}
使用属性配置的方式配置Feign日志级别
Raw Copy
# application.yml
feign:
client:
config:
# 全局配置
defalut:
loggerLevel: full

Comment list( 0 )

Sign in for post a comment

Help Search