1
0
mirror of https://github.com/containous/traefik.git synced 2025-01-10 01:17:55 +03:00
traefik/pkg/responsemodifiers/log.go

14 lines
412 B
Go
Raw Normal View History

2018-11-14 12:18:03 +03:00
package responsemodifiers
import (
"context"
2019-08-03 04:58:23 +03:00
"github.com/containous/traefik/v2/pkg/log"
2018-11-14 12:18:03 +03: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)
}