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