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

Improve Dict log for reqHeaders & resHeaders #965

Merged
merged 1 commit into from
Feb 24, 2024

Conversation

roman-wb
Copy link
Contributor

Hi, @ReneWerner87!

What do you think about it?

  1. Improved request headers log:
    Was:
    {"method":"POST"," header_key":"header_value"}
    Became with sub dict:
    {"method":"POST", "reqHeaders": {"header_key":"header_value"}}
  2. Added response headers log (with field FieldResHeaders = "resHeaders"):
    {"method":"POST", "resHeaders": {"header_key":"header_value"}}

@ReneWerner87
Copy link
Member

thx for the PR, but iam not really an expert for this MW
i will tag someone with more exp

@ReneWerner87
Copy link
Member

@iredmail @raphielscape @dotX12 what do you think?

@raphielscape
Copy link
Contributor

Seems like a breaking change for me, but overall it's fine

@dotX12
Copy link
Contributor

dotX12 commented Feb 21, 2024

This will affect users who have header filters configured, for example, dashboards in Grafana, i.e. this is a serious change.

But in the long run it looks sensible, I’m all for it.
LGTM...

@ReneWerner87
Copy link
Member

so it's a breaking change
would it be possible to design this change without breaking?

@dotX12
Copy link
Contributor

dotX12 commented Feb 21, 2024

so it's a breaking change would it be possible to design this change without breaking?

I would add a flag so that users can choose the format for listing headers.
Something like:

HeadersFormat: rolled | unrolled

maybe

HeadersFormat : flat | object

or

WrapHeaders: true / false

In this case, we won't break anything :)

@roman-wb roman-wb force-pushed the zerolog_headers_dict branch from 76c4f2b to ecd8c11 Compare February 22, 2024 14:44
@roman-wb
Copy link
Contributor Author

Thx, without breaking done)

@ReneWerner87 ReneWerner87 merged commit 0a4bfe2 into gofiber:main Feb 24, 2024
56 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants