-
Notifications
You must be signed in to change notification settings - Fork 614
Open
Description
There is a very confusing problem for me when using zerolog:
log.Ctx(ctx) doesn't insert the provided context in the Event, resulting in logs without telemetry data
The solution is quite ugly:
import "github.com/rs/zerolog/log"
...
log.
Ctx(ctx). // Retrieves the logger from context, without setting the context for Event.
Info(). // Creates an event
Ctx(ctx). // Sets the ctx for the Event so we can retrieve telemetry data.
...I think it would be highly convenient that we do not have to set the event context if the log is already created from a context.
Am I doing something wrong here?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels