6.3、Feign接口日志配置
官网参考地址:
https://cloud.spring.io/spring-cloud-static/Greenwich.RELEASE/single/spring-cloud.html#_feign_logging
步1、配置日志
根据官方说明,日志级别只识别DEBUG。且是设置具体接口名称。

步2、在配置类是设置为FULL
package cn.wangjian.config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import feign.Logger;
/**Feign配置文件,需要添加@Configuration注解,最此类与
Ribbon的@Configuration相同,不能放到@ComponentScan包下*/
@Configuration
public class MyFeignConfig {
@Bean
public Logger.Level feignLoggerLevel() {
return Logger.Level.FULL;
}
}
步3、访问查看日志
以下是具体日志


文章转载自Coding On Road,如果涉嫌侵权,请发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。




