mirror of
https://github.com/containous/traefik.git
synced 2025-01-21 18:03:50 +03:00
14 lines
399 B
Go
14 lines
399 B
Go
package middlewares
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/containous/traefik/log"
|
|
"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)
|
|
}
|