Documentation ¶
Overview ¶
Package ctxlogger provides a Gizmo middleware that automatically adds a given logger to the request context. It includes any path variable as fields in the logger.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ContextKey = &struct{ key string }{key: "ctxlogger"}
ContextKey is the key used by the middleware to set the logger.
Functions ¶
func ContextLogger ¶
ContextLogger takes the logger and returns the middleware that will always add the logger to the request context.
It also expands the logger with any path variable on the given request (using path variables as defined with Gizmo).
Last, but not least, it also tracks request ids using the header X-Request-Id.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.