1.导入pom依赖
<!--feign配置HttpClient-->
<dependency>
<groupId>io.github.openfeign</groupId>
<artifactId>feign-httpclient</artifactId>
</dependency>
2.yml配置httpclient
feign:
httpclient:
enabled: true #开启httpclient
max-connections: 200 #最大连接数
max-connections-per-route: 50 #单路径最大连接数
3.配置日志级别为Basic
3.1 第一种yml(全局生效)
feign:
client:
config:
default:
loggerLevel: BASIC
3.2 java方式 (全局生效)
public class FeignConfiguration {
@Bean
Logger.Level feignLogLevel(){
return Logger.Level.FULL;
}
}
在注解启动日志
@EnableFeignClients(defaultConfiguration = FeignConfiguration.class)