You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This RFC proposes introducing log levels to the project's logging mechanism to provide greater granularity and control over log outputs. The implementation will leverage the Go slog library introduced in Go 1.21, inspired by the logr interface. This change will facilitate improved debugging, monitoring, and operational insights, especially for large-scale deployments.
Background
Currently, the project uses the standard Go logging package log for all logging needs. While functional, this approach lacks support for log levels, making it challenging to differentiate between critical errors, warnings, informational messages, and debug details.
As the project has grown, this limitation has made logs harder to parse and has increased noise and complicating debugging and monitoring efforts.
The slog library, designed for structured logging, provides a robust framework for introducing log levels. It aligns well with modern logging needs and is compatible with the logr interface, commonly used in Kubernetes and other ecosystems.
Proposal
This RFC proposes:
Adopting slog: Replace the standard log package with the slog library for logging.
Introducing Log Levels: Define log levels:
Debug: Detailed diagnostic information for development or analyzing issues
Info: General operational messages that highlight application flow.
Error: Severe issues that require immediate attention.
Structured Logging: Leverage slog's support for structured logging to include key-value pairs in logs for easier parsing and analysis.
Configuration: Add a mechanism for configuring log levels at runtime, defaulting to Info for production builds.
The text was updated successfully, but these errors were encountered:
Summary
This RFC proposes introducing log levels to the project's logging mechanism to provide greater granularity and control over log outputs. The implementation will leverage the Go
slog
library introduced in Go 1.21, inspired by the logr interface. This change will facilitate improved debugging, monitoring, and operational insights, especially for large-scale deployments.Background
Currently, the project uses the standard Go logging package
log
for all logging needs. While functional, this approach lacks support for log levels, making it challenging to differentiate between critical errors, warnings, informational messages, and debug details.As the project has grown, this limitation has made logs harder to parse and has increased noise and complicating debugging and monitoring efforts.
The
slog
library, designed for structured logging, provides a robust framework for introducing log levels. It aligns well with modern logging needs and is compatible with the logr interface, commonly used in Kubernetes and other ecosystems.Proposal
This RFC proposes:
The text was updated successfully, but these errors were encountered: