OpenFeign / OpenFeign/feign

Log HTTP body, not headers

Open
#1,888 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
9.8k
Forks
1.9k
Avg merge
1d 2h
Merged PRs (30d)
41

Description

It could be useful to allow logging of HTTP body but not headers.

In some cases, headers contains restricted / confidential information such as usernames, passwords, tokens, so you don't want to write them to logs. Whilst HTTP body could contribute useful information.

Actually feign.Logger doesn't have a feign.Logger.Level allowing to configure logging of HTTP body but not headers.

To do that you could create feign.Logger subclass, and rewrite logRequest and logAndRebufferResponse methods.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with feign.Logger, especially logRequest and logAndRebufferResponse, which the issue identifies as the current extension points. Define how a logging level should permit HTTP body logging while excluding headers, then verify that request and response bodies remain available without confidential header values being written to logs.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.