Feign logging

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" />
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章