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 gRPC logger to log structured fields #141

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

rlenglet
Copy link
Collaborator

@rlenglet rlenglet commented Feb 28, 2025

  • Reimplement gRPC logger as a Zap Core wrapper instead of a Core hook, so it can log the structured log fields.
  • Replace SugaredLogger with Logger in the whole codebase to improve efficiency and eliminate formatting bugs.
  • Encode each entry into a string immediately when logged, before buffering, and never refer to the input Entry and Fields afterwards, as it is more compact and it allows the entry and fields to be garbage-collected while the log entry is buffered.

rlenglet added 2 commits March 1, 2025 02:14
Reimplement gRPC logger as a Zap Core wrapper instead of a hook,
so it can log the structure log fields.

Replace SugaredLogger with Logger in all the codebase
to improve efficience and eliminate formatting bugs.
Encode each entry into a string immediately when logged, before
buffering, and never refer to the input Entry and Fields afterwards,
as it is more compact and it allows the fields to be garbage-collected
while the log entry is buffered.
@rlenglet rlenglet changed the title Fix gRPC logger to parse log entry messages as JSON objectsp Fix gRPC logger to log structured fields Mar 1, 2025
@rlenglet rlenglet marked this pull request as ready for review March 1, 2025 06:03
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