Skip to content

Replace slog with zap for global logging #1459

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

rvarun11
Copy link
Contributor

@rvarun11 rvarun11 commented Aug 18, 2025

Closes #383

Based on the feedback received in #1362, this PR:

  • Switches from slog to zap's global SugaredLogger
  • Maintains structured/unstructured log switching via UNSTRUCTURED_LOGS
  • Preserves debug flag integration for log level control
  • Uses go-logr/zapr for NewLogr() Kubernetes logr.Logger compatibility

It also:

  • Adds *w functions (Debugw, Infow, etc.) for structured key-value logging
  • Adds DPanic and Fatal log levels with corresponding *f/*w variants

Optionally, we can consider updating the logger.Initialize() to init().

* Switch from slog to uber-go/zap SugaredLogger for better performance
* Add *w functions (Debugw, Infow, etc.) for structured key-value logging
* Add DPanic and Fatal log levels with corresponding *f/*w variants
* Maintain structured/unstructured log switching via UNSTRUCTURED_LOGS
* Preserve debug flag integration for log level control
* Use go-logr/zapr for NewLogr() Kubernetes logr.Logger compatibility
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.

Replace internal logger with zap library
1 participant