Documentation
¶
Overview ¶
Package ginlog traces and logs the requests a gin server answers, with the logs set up by the telemetry package
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LogAttrs ¶
LogAttrs adds attrs, such as the signed-in user's id, to the records written with the request's context from now on, and to the line the request is logged with
func Middleware ¶
func Middleware( serviceName string, public bool, levels telemetry.RequestLevels, onPanic func(*gin.Context), ) []gin.HandlerFunc
Middleware returns the middleware that traces each request and logs it at the level for how it ended. When public is set, the trace id a caller sends is ignored and each request starts its own trace. onPanic answers a request whose handler panicked, after the panic is logged, unless the handler had started its answer; a plain 500 when nil.
Types ¶
This section is empty.