使用Spring Cloud Feign 日志查看请求响应

时间:2018-08-31 01:20:19   收藏:0   阅读:2008

在使用微服务时,常常会用feign做客户端去调用别的微服务,但是在日志中很难查看到具体的请求和响应。因此,需要把feign默认的日志打开。

日志设置


@Configuration
public class FeignLogConfiguration {

    @Bean
    Logger.Level feignLoggerLevel() {

        return Logger.Level.FULL;

    }
}

技术分享图片

logging.level.com.wugui.spring.cloud.weather.Service:debug

技术分享图片

日志查看

技术分享图片

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!