traefik/pkg/middlewares/middleware.go

13 lines
360 B
Go
Raw Normal View History

2018-11-14 09:18:03 +00:00
package middlewares
import (
"context"
2019-08-03 01:58:23 +00:00
"github.com/containous/traefik/v2/pkg/log"
2018-11-14 09:18:03 +00:00
)
2019-09-13 17:28:04 +00:00
// GetLoggerCtx creates a logger context with the middleware fields.
2020-07-07 12:42:03 +00:00
func GetLoggerCtx(ctx context.Context, middleware, middlewareType string) context.Context {
2019-09-13 17:28:04 +00:00
return log.With(ctx, log.Str(log.MiddlewareName, middleware), log.Str(log.MiddlewareType, middlewareType))
2018-11-14 09:18:03 +00:00
}