spring cloud netfix组件中,feign相关的日志默认是不会输出的。
Logger.Level用于通知Feign进行记录的log的详细程度。
NONE, No logging (DEFAULT).
BASIC, Log only the request method and URL and the response status code and execution time.
HEADERS, Log the basic information along with request and response headers.
FULL, Log the headers, body, and metadata for both requests and responses.
NONE, 不记录 (DEFAULT).
BASIC, 仅记录请求方式和URL及响应的状态代码与执行时间.
HEADERS, 日志的基本信息与请求及响应的头.
FULL, 记录请求与响应的头和正文及元数据.
@Bean
public Logger.Level feignLoggerLevel() {
return feign.Logger.Level.FULL;
}
Feign日志只响应 DEBUG 级别
<logger name="com.demo.user.UserClient" level="DEBUG" />