Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddCustomAttributes ¶ added in v1.8.0
AddCustomAttributes adds custom attributes to the request context.
Types ¶
type IPExtractor ¶
type Option ¶
type Option func(cfg *config)
func WithFilter ¶
WithFilter adds a filter to the list of filters used by the middleware. If any filter indicates to exclude a request then the request will not be logged. All filters must allow a request to be logged. If no filters are provided, then all requests are logged.
func WithIPExtractor ¶
func WithIPExtractor(extractor IPExtractor) Option
WithIPExtractor takes a function that will be called on every request and the returned ip will be added to the log entry.
http.Request RemoteAddr is logged by default.
Click to show internal directories.
Click to hide internal directories.