Skip to content
This repository was archived by the owner on Aug 16, 2026. It is now read-only.

feat: Configurable IncluHeader configuration item - #5

Open
salleh wants to merge 17 commits into
brpaz:masterfrom
berrypay:master
Open

feat: Configurable IncluHeader configuration item#5
salleh wants to merge 17 commits into
brpaz:masterfrom
berrypay:master

Conversation

@salleh

@salleh salleh commented Sep 8, 2023

Copy link
Copy Markdown

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 subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants