1
0
mirror of https://github.com/containous/traefik.git synced 2025-01-10 01:17:55 +03:00
traefik/pkg/middlewares/middleware.go

13 lines
357 B
Go
Raw Normal View History

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