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
|
|
|
"github.com/sirupsen/logrus"
|
|
|
|
)
|
|
|
|
|
|
|
|
// GetLogger creates a logger configured with the middleware fields.
|
|
|
|
func GetLogger(ctx context.Context, middleware string, middlewareType string) logrus.FieldLogger {
|
|
|
|
return log.FromContext(ctx).WithField(log.MiddlewareName, middleware).WithField(log.MiddlewareType, middlewareType)
|
|
|
|
}
|