traefik/pkg/middlewares/middleware.go
2020-07-07 14:42:03 +02:00

12 lines
360 B
Go

package middlewares
import (
"context"
"github.com/containous/traefik/v2/pkg/log"
)
// GetLoggerCtx creates a logger context with the middleware fields.
func GetLoggerCtx(ctx context.Context, middleware, middlewareType string) context.Context {
return log.With(ctx, log.Str(log.MiddlewareName, middleware), log.Str(log.MiddlewareType, middlewareType))
}