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.
|
|
|
|
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 09:18:03 +00:00
|
|
|
}
|