[Bug]: Allow traffic logging to log the response body only for backend error responses

Open
#4,178 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
52/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
go

Research direction

Start by reading the traffic_logging configuration and the gateway code that records backend responses; the issue does not name specific files or tests. Trace how response_body = true is applied, then identify where backend error responses can be distinguished from successful responses. Done means traffic logging can include response bodies for backend errors while omitting them for successful responses.

Written by the indexing model from the issue text.

Description

Aspect/API Severity/Major Type/Bug
Please select the area the issue is related to

Gateway

Please select the aspect the issue is related to

Aspect/API (API backends, definitions, contracts, interfaces, OpenAPI)

Description

When response_body = true is set under [traffic_logging], the API Platform Gateway logs the response body for every backend response, including successful ones. There’s no way to limit body logging to failures, so logs get much bigger and payloads that aren’t needed end up stored.

Steps to Reproduce

N/A

Severity Level of the Issue

Severity/Major (Important functionality is broken. Should be prioritized. Doesn't need immediate attention)

Environment Details (with versions)

No response

Dominant language
Go
Stars
85
Forks
137
Avg merge
1d 12h
Merged PRs (30d)
247

Getting set up

  • No Dockerfile or Docker Compose file
  • Has a pull request template
  • No 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.

More from wso2/api-platform

All issues in wso2/api-platform

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.