Documentation
¶
Overview ¶
Package ctxlog carries a request ID through a context.Context so logs emitted anywhere in a request share a request_id field.
The context carries only the request ID, not a logger. Each component keeps logging through its own logger (preserving its component-specific fields) and annotates it with the request_id via Logger, instead of being replaced by a request-scoped logger that would lose those fields.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Logger ¶
Logger annotates base with the request_id carried by ctx.
When ctx carries no request ID (e.g. background work, tests), base is returned unchanged. base keeps all its own fields, so the component-specific context is preserved alongside the request_id.
Types ¶
This section is empty.