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: Configurable IncluHeader configuration item #5

Open
wants to merge 17 commits into
base: master
Choose a base branch
from

Conversation

salleh
Copy link

@salleh salleh commented Sep 8, 2023

Introduce IncludeHeader as new ZapLoggerConfig item.

The IncludeHeader will default to nil. To include specific header into the log item, pass a string slice that contains the list of header key:
e.g:

echozap.ZapLoggerConfig{ IncludeHeader: []string{ echo.HeaderXRequestId, "My-Custom-Header-Key", } }

For consistency purpose, ALL the header key will be converted to lowercase before registered as the log field key (as getting the header from the http context will assume a case insensitive canonical form).

POTENTIAL BREAKING CHANGES TO RUNTIME RESULT
Prior and including version 1.1.3 of #brpaz/echozap, echozap will automatically add a log field "request-id" to represent "X-Request-Id" header regardless if it is being sent or not.

With this release, it is not automatically added anymore. The log field key will not be changed and it will maintain the original header key.

VDVsx and others added 8 commits May 26, 2023 13:36
Since the forked repo appeared to be unmaintained,
we are pulling this open PR in:
brpaz#4

Signed-off-by: Valério Valério <vdv100@gmail.com>
Explicitly mention that this is a public fork
Signed-off-by: Valério Valério <vdv100@gmail.com>
Merge skipper middleware configuration from Unity-Technologies/echozap
@salleh salleh changed the title Added Feature: Configurable IncluHeader configuration item feat: Configurable IncluHeader configuration item Sep 8, 2023
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