aboutsummaryrefslogtreecommitdiff
path: root/vendor/github.com/containerd/containerd/log/context.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/containerd/containerd/log/context.go')
-rw-r--r--vendor/github.com/containerd/containerd/log/context.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/vendor/github.com/containerd/containerd/log/context.go b/vendor/github.com/containerd/containerd/log/context.go
index 37b6a7d1c..0db9562b8 100644
--- a/vendor/github.com/containerd/containerd/log/context.go
+++ b/vendor/github.com/containerd/containerd/log/context.go
@@ -52,7 +52,8 @@ const (
// WithLogger returns a new context with the provided logger. Use in
// combination with logger.WithField(s) for great effect.
func WithLogger(ctx context.Context, logger *logrus.Entry) context.Context {
- return context.WithValue(ctx, loggerKey{}, logger)
+ e := logger.WithContext(ctx)
+ return context.WithValue(ctx, loggerKey{}, e)
}
// GetLogger retrieves the current logger from the context. If no logger is
@@ -61,7 +62,7 @@ func GetLogger(ctx context.Context) *logrus.Entry {
logger := ctx.Value(loggerKey{})
if logger == nil {
- return L
+ return L.WithContext(ctx)
}
return logger.(*logrus.Entry)