Merge pull request #36475 from IRCody/logdriver-errors

daemon/logger/ring.go: log error not instance
This commit is contained in:
Yong Tang 2018-03-03 15:51:35 -08:00 committed by GitHub
commit 954e55b374
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -93,7 +93,10 @@ func (r *RingLogger) Close() error {
}
if err := r.l.Log(msg); err != nil {
logrus.WithField("driver", r.l.Name()).WithField("container", r.logInfo.ContainerID).Errorf("Error writing log message: %v", r.l)
logrus.WithField("driver", r.l.Name()).
WithField("container", r.logInfo.ContainerID).
WithError(err).
Errorf("Error writing log message")
logErr = true
}
}
@ -114,7 +117,10 @@ func (r *RingLogger) run() {
return
}
if err := r.l.Log(msg); err != nil {
logrus.WithField("driver", r.l.Name()).WithField("container", r.logInfo.ContainerID).Errorf("Error writing log message: %v", r.l)
logrus.WithField("driver", r.l.Name()).
WithField("container", r.logInfo.ContainerID).
WithError(err).
Errorf("Error writing log message")
}
}
}