1
0
Fork 0

fix: logger and context.

This commit is contained in:
Ludovic Fernandez 2019-09-13 19:28:04 +02:00 committed by Traefiker Bot
parent b4c7b90c9e
commit 8e18d37b3d
52 changed files with 231 additions and 183 deletions

View file

@ -6,6 +6,7 @@ import (
"github.com/containous/alice"
"github.com/containous/traefik/v2/pkg/config/dynamic"
"github.com/containous/traefik/v2/pkg/log"
"github.com/containous/traefik/v2/pkg/middlewares"
)
@ -19,7 +20,7 @@ type chainBuilder interface {
// New creates a chain middleware
func New(ctx context.Context, next http.Handler, config dynamic.Chain, builder chainBuilder, name string) (http.Handler, error) {
middlewares.GetLogger(ctx, name, typeName).Debug("Creating middleware")
log.FromContext(middlewares.GetLoggerCtx(ctx, name, typeName)).Debug("Creating middleware")
middlewareChain := builder.BuildChain(ctx, config.Middlewares)
return middlewareChain.Then(next)