OpenFeign / OpenFeign/feign

Log request (and response) in single batch

Open
#1,035 4 comments 11 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Feign's Logger is logging once per request / response line item.
For example, JavaLogger will log the following request / response pair by invoking java.util.logging.Logger 7 times:

[SendsStuff#login] ---> POST http://localhost:61113/ HTTP/1.1
[SendsStuff#login] Content-Length: 80
[SendsStuff#login] Content-Type: application/json
[SendsStuff#login] ---> END HTTP (80-byte body)
[SendsStuff#login] <--- HTTP/1.1 200 OK (1ms)
[SendsStuff#login] content-length: 3
[SendsStuff#login] <--- END HTTP (3-byte body)

Currently, in a Kibana + Logstash environment, these log line are scattered, having one document per log line. The logs for one single request are scattered in different documents. The same goes for the response. Thus, it's difficult to follow the logs.

What I'm suggesting is to have some sort of log batching, such that we end up with one log call for the request, another for the response. Having a single log per request/response means having a single document for request, another for response. That would be much easier to follow.

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's Logger and JavaLogger entry points described in the issue, and trace how request and response line items are emitted. Compare the current per-line calls with the desired request and response boundaries. Done means each request and response is emitted through one log call while retaining the shown information.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
observability
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.