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

fix: correct example to avoid zerolog fields combined #569

Merged
merged 1 commit into from
Apr 18, 2023

Conversation

levanlongktmt
Copy link

@levanlongktmt levanlongktmt commented Apr 16, 2023

I follow the current code in the example of using zerolog and fields grown after each request. It combines all fields to the context of l after each request and makes the log messages become huge.
It's the same with this issue on zap #559

image

I fixed this by creating a new instance of zerolog.Logger instead of using l and it works like a charm.

image

  • I added CHANGELOG entry for this change.
  • Change is not relevant to the end user.

Changes

  • Correct example of interceptors/logging/examples/zerolog

Verification

I tested and it works on my project, logs work fine and didn't get combined fields

@google-cla
Copy link

google-cla bot commented Apr 16, 2023

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@johanbrandhorst johanbrandhorst merged commit e4c2f09 into grpc-ecosystem:v2 Apr 18, 2023
@johanbrandhorst
Copy link
Collaborator

Thanks for the fix!

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