SpringCloud增加Feign日志打印
package com.xiaohang.socialcard.pre.feign;import feign.Logger;import org.springframework.context.annotation.Bean;import org.springframework.context.annotation.Configuration;@Configurationpublic class FeignConfiguration { @Bean Logger.Level feignLoggerLevel() { //这里记录所有,根据实际情况选择合适的日志level return Logger.Level.FULL; }}
二、Application.yml配置需要打印Feign请求日志的API接口
logging.level.com.xiaohang.socialcard.pre.feign.ChangShaApi: debug
三、打印示例:
2019-07-05 17:32:42.478 DEBUG 99302 --- [ngsha-payment-3] c.x.socialcard.pre.feign.ChangShaApi : [ChangShaApi#getToken] ---> GET http://xx.xx.xx.xx:xxxx/openInter/getToken?......2019-07-05 17:32:42.566 DEBUG 99302 --- [ngsha-payment-3] c.x.socialcard.pre.feign.ChangShaApi : [ChangShaApi#getToken] <--- END HTTP (454-byte body)
声明:本站所有文章资源内容,如无特殊说明或标注,均为采集网络资源。如若本站内容侵犯了原著者的合法权益,可联系本站删除。