Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Request body logging in debug level #2397

Merged
merged 6 commits into from
Sep 24, 2024

Conversation

augustinasrce
Copy link
Contributor

@augustinasrce augustinasrce commented Sep 20, 2024

Description

Please add a description of what your pull request is doing.

  • What was the problem?

In order to debug, request body is very helpful.

  • How it is resolved?

Introduced request body logging

  • How can we test the change?

Enabled/disable debug log level and check logs. Unit tests also available.

  • If there are breaking changes, please describe them in detail and why we cannot avoid them.

None

Closes issue(s)

#2396

Checklist

  • I have tested this code
  • I have added unit test to cover this code
  • I have updated the documentation (README.md and /website/docs)
  • I have followed the contributing guide

Copy link

netlify bot commented Sep 20, 2024

Deploy Preview for go-feature-flag-doc-preview canceled.

Name Link
🔨 Latest commit 5e6d002
🔍 Latest deploy log https://app.netlify.com/sites/go-feature-flag-doc-preview/deploys/66f285762d313000089dba05

@augustinasrce augustinasrce changed the title Request body logging in debug level #2396 feat: Request body logging in debug level #2396 Sep 20, 2024
@augustinasrce augustinasrce changed the title feat: Request body logging in debug level #2396 feat: Request body logging in debug level Sep 20, 2024
Copy link

codecov bot commented Sep 20, 2024

Codecov Report

Attention: Patch coverage is 57.14286% with 3 lines in your changes missing coverage. Please review.

Project coverage is 86.02%. Comparing base (5bd1da2) to head (5e6d002).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
cmd/relayproxy/api/server.go 57.14% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2397      +/-   ##
==========================================
- Coverage   86.08%   86.02%   -0.06%     
==========================================
  Files         102      102              
  Lines        3794     3801       +7     
==========================================
+ Hits         3266     3270       +4     
- Misses        402      405       +3     
  Partials      126      126              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Owner

@thomaspoignant thomaspoignant left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @augustinasrce thanks for your pull request.

This is a great addition to log the request body, but since we are using an existing middleware I am not sure why we need our own file in the middleware section, I would prefer that we include directly the middleware in the server.go file as suggested.

cmd/relayproxy/api/server.go Outdated Show resolved Hide resolved
cmd/relayproxy/api/middleware/body.go Outdated Show resolved Hide resolved
cmd/relayproxy/api/middleware/body.go Outdated Show resolved Hide resolved
@augustinasrce
Copy link
Contributor Author

Hey @augustinasrce thanks for your pull request.

This is a great addition to log the request body, but since we are using an existing middleware I am not sure why we need our own file in the middleware section, I would prefer that we include directly the middleware in the server.go file as suggested.

Idea was to keep things simple, without big nested structures (in case it gets bigger). Since it's quite small at the moment I'll update PR as You suggested.

Copy link

sonarcloud bot commented Sep 24, 2024

@thomaspoignant thomaspoignant merged commit 2659d12 into thomaspoignant:main Sep 24, 2024
20 of 22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants