Documentation
¶
Overview ¶
Package log provides zerolog-based structured logging for Go services, with OpenTelemetry trace_id/span_id correlation drawn from the active span context.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Ctx ¶
Ctx returns a zerolog.Logger derived from the base logger with the active span's trace_id and span_id attached when ctx carries a valid span. This lets every log line be correlated with its trace in the tracing backend. When no valid span is present, it returns the plain base logger.
func New ¶
New returns a zerolog.Logger with a timestamp and the given service name attached to every line, filtered to the level from LOG_LEVEL (default info) and rendered per LOG_FORMAT (JSON by default, console/pretty for dev). Consumers no longer need to parse LOG_LEVEL or wire a writer themselves -- calling New is enough.
Types ¶
This section is empty.