You need to configure logging in application.properties as below:

logging.level.<package path>.MyClient=DEBUG

If you're using application.yml then:

logging.level.<package path>.MyClient: DEBUG

The log level can be set to tell Feign how much to log.

Options are:

  • 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

Example:

logLevel(feign.Logger.Level.NONE)
or
logLevel(feign.Logger.Level.BASIC)
or
logLevel(feign.Logger.Level.HEADERS)
or
logLevel(feign.Logger.Level.FULL)

For more details, you can refer this

Answer from Maverick on Stack Overflow
🌐
Baeldung
baeldung.com › home › spring › spring boot › feign logging configuration
Feign Logging Configuration | Baeldung
February 26, 2025 - To enable logging, we need to set the Spring Boot logging level to DEBUG for the class or package that contains our feign client in the application.properties file.
Top answer
1 of 6
83

Feign has out of box logging mechanism and it can be achieved through simple steps.

If you are using spring-cloud-starter-feign

Feign using Slf4jLogger for logging.Feign logging documentation

As per doc, the below logging levels are available to configure,

  • 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.

Injecting the Logger.Level bean is enough.

    @Bean
    Logger.Level feignLoggerLevel() {
        return Logger.Level.BASIC;
    }

OR

If you prefer using configuration properties to configured all @FeignClient, you can create configuration properties with default feign name.

feign:
  client:
    config:
      default:
        loggerLevel: basic

of if you are using a newer version (Spring Boot 3) the config will be like:

spring:
  cloud:
    openfeign:
      client:
        config:
          default:
            loggerLevel: full

If you are using 'io.github.openfeign:feign-core'

If you are constructing the Feign builder then you can mention logLevel(Level.BASIC) as

Feign.builder()
    .logger(new Slf4jLogger())
    .logLevel(Level.BASIC)
    .target(SomeFeignClient.class, url);

We have the flexibility to customize the logging message

The default feign request and response logging

Request logging

Resopnse logging

we can customize the feign request, response logging pattern by overriding Logger#logRequest and Logger#logAndRebufferResponse methods. In the following example, we have customized request logging pattern

log(configKey, "---> %s %s HTTP/1.1 (%s-byte body) ", request.httpMethod().name(), request.url(), bodyLength);

and response logging pattern

log(configKey, "<--- %s %s HTTP/1.1 %s (%sms) ", request.httpMethod().name(), request.url(), status, elapsedTime);

The Full example is


import feign.Logger;
import feign.Request;
import feign.Response;
import lombok.extern.slf4j.Slf4j;

import java.io.IOException;

import static feign.Logger.Level.HEADERS;

@Slf4j
public class CustomFeignRequestLogging extends Logger {

    @Override
    protected void logRequest(String configKey, Level logLevel, Request request) {

        if (logLevel.ordinal() >= HEADERS.ordinal()) {
            super.logRequest(configKey, logLevel, request);
        } else {
            int bodyLength = 0;
            if (request.requestBody().asBytes() != null) {
                bodyLength = request.requestBody().asBytes().length;
            }
            log(configKey, "---> %s %s HTTP/1.1 (%s-byte body) ", request.httpMethod().name(), request.url(), bodyLength);
        }
    }

    @Override
    protected Response logAndRebufferResponse(String configKey, Level logLevel, Response response, long elapsedTime)
            throws IOException {
        if (logLevel.ordinal() >= HEADERS.ordinal()) {
            return super.logAndRebufferResponse(configKey, logLevel, response, elapsedTime);
        } else {
            int status = response.status();
            Request request = response.request();
            log(configKey, "<--- %s %s HTTP/1.1 %s (%sms) ", request.httpMethod().name(), request.url(), status, elapsedTime);
            return response;   
        }        
    }


    @Override
    protected void log(String configKey, String format, Object... args) {
        log.debug(format(configKey, format, args));
    }

    protected String format(String configKey, String format, Object... args) {
        return String.format(methodTag(configKey) + format, args);
    }
}

NOTE: Request payload can be easily logged through

String bodyText =
              request.charset() != null ? new String(request.body(), request.charset()) : null;

but be careful writing the response payload after you are reading the input stream Util.toByteArray(response.body().asInputStream()) then you have to construct the response again like response.toBuilder().body(bodyData).build(). Otherwise, you will end up with the expection. The reason is response streams are read and always closed before returning, thats why the method is named as logAndRebufferResponse

How to use the custom CustomFeignRequestLogging?

If you are building feign client using just 'io.github.openfeign:feign-core'

Feign.builder()
     .logger(new CustomFeignRequestLogging())
     .logLevel(feign.Logger.Level.BASIC);

If you are using 'org.springframework.cloud:spring-cloud-starter-openfeign'

@Configuration
public class FeignLoggingConfiguration {

    @Bean
    public CustomFeignRequestLogging customFeignRequestLogging() {
        return new CustomFeignRequestLogging();
    }

    @Bean
    Logger.Level feignLoggerLevel() {
        return Logger.Level.BASIC;
    }
}

2 of 6
13

The accepted answer did not work for me until I added the following settings to my application.yml file:

logging:
  level:
    com:
      mypackage1:
        mysubackage1:
          mysubpackage2: DEBUG
🌐
Medium
medium.com › @somarouthu.sivaprasads › spring-cloud-feign-858c225e2341
Spring Cloud Feign. Logging: | by SivaprasadS | Medium
March 15, 2019 - To enable logging we have to set the feign.Logger level(Default is NONE). This can be done in 2 days · Setting feign.client.config.default.loggerLevel = FULL either in application.Properties / application.yml File
🌐
Javacodemonk
javacodemonk.com › feign-client-logging-and-connection-timeout-spring-boot-60b8826d
Feign Client Logging and connection timeout
July 14, 2020 - feign: client: config: name_of_your_feign_client: (1) connectTimeout: 5000 readTimeout: 5000 loggerLevel: basic
🌐
Medium
medium.com › @reetesh043 › handling-logging-in-spring-boot-feignclient-a-complete-guide-0831676b8526
Handling Logging in Spring Boot FeignClient: A Complete Guide | by Reetesh Kumar | Medium
August 5, 2025 - Without proper logging, debugging becomes a guessing game. By default, Feign logging is disabled (NONE level), so you need to explicitly configure it to capture communication details between your microservices.
🌐
GitHub
github.com › OpenFeign › feign › blob › master › core › src › main › java › feign › Logger.java
feign/core/src/main/java/feign/Logger.java at master · OpenFeign/feign
* Override to log requests and responses using your own implementation. Messages will be http · * request and response text. * * @param configKey value of {@link Feign#configKey(Class, java.lang.reflect.Method)} * @param format {@link java.util.Formatter format string} * @param args arguments applied to {@code format} */ protected abstract void log(String configKey, String format, Object...
Find elsewhere
🌐
Getdocs
spring.getdocs.org › en-US › spring-cloud-docs › spring-cloud-openfeign › spring-cloud-feign › feign-logging.html
Untitled :: Spring Docs
A logger is created for each Feign client created. By default the name of the logger is the full class name of the interface used to create the Feign client.
🌐
Mayukh Datta
thecoducer.com › 2023 › 03 › custom-logger-configuration-for-feign-clients
Custom Logger Configuration for Feign Clients · Mayukh Datta
March 26, 2023 - Feign uses SL4j Logger under the hood, and the default logging configuration prints each piece of information on a separate line, which I found disturbing. So, I created a custom logger for the Feign clients to customize the log statements.
🌐
Spring Cloud
cloud.spring.io › spring-cloud-openfeign › 2.2.x › reference › html
Spring Cloud OpenFeign
Feign logging only responds to the DEBUG level. ... The Logger.Level object that you may configure per client, tells Feign how much to log.
🌐
GitHub
github.com › spring-cloud › spring-cloud-netflix › issues › 1769
Feign Logging Configuration Not Working As Documented · Issue #1769 · spring-cloud/spring-cloud-netflix
March 11, 2017 - And I've configured my Config Server to customize the logging level for the Feign Client with this full package name: com.example.ReservationReader.
🌐
GitHub
github.com › swagger-api › swagger-codegen › issues › 10550
How to add Feign Client Logging in SpringBoot through ...
November 8, 2020 - https://cloud.spring.io/spring-cloud-netflix/multi/multi_spring-cloud-feign.html#_feign_logging · logging: level: platform.client.parkingplus.api.ServicoPagamentoTicket2Api: DEBUG feign: client: config: default: loggerLevel: FULL
Author: swagger-api
🌐
Junhyunny
junhyunny.github.io › spring-boot › spring-cloud › logging-for-feign-client
FeignClient 로깅 적용하기 - Junhyunny’s Devlogs
April 25, 2026 - package action.in.blog.config; import feign.Logger; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; @Configuration public class FeignLoggerConfig { @Bean Logger.Level feignLoggerLevel() { return Logger.Level.FULL; } } 간단한 테스트 코드를 통해 출력되는 로그를 살펴보자. 다음과 같은 BlogClient 인터페이스를 만든다. 메서드들을 수행할 때 출력되는 로그를 살펴본다. GET 요청 · GET 요청 - 파라미터 추가 · POST 요청 - 바디 추가 · package action.in.blog.client; import
🌐
Mingliang
mingliang.me › blog › rest-client-logging-in-spring-boot
Rest client logging in spring boot - You Will Never Walk Alone
July 23, 2019 - A logger is created for each Feign client created. By default the name of the logger is the full class name of the interface used to create the Feign client.
🌐
Poznachowski
blog.poznachowski.pl › posts › feign-slf4j-logger
Feign Slf4j Logger you wish you had // It's SOAP's Fault...
August 17, 2021 - You can change amount of log data you want, by changing SLF4j log level of a specific Feign client class.
🌐
Medium
bvn13.medium.com › normalized-logger-for-openfeign-8727b4e5d776
Normalized Logger for OpenFeign. Standard Feign logger provides the only… | by Vyacheslav Boyko | Medium
August 12, 2022 - logging: level: me.bvn13.openfeign.logger.NormalizedFeignLogger: DEBUG · feign: client: config: auth: logger-level: FULL · Main code of project is placed into https://gitea.bvn13.me/bvn13/OpenFeign-NormalizedLogger · Github clone of the repo is https://github.com/bvn13/OpenFeign-NormalizedLogger ·