1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

daemon/logger/ring.go: log error not instance

Log the error returned from logdriver.Log() instead of the logdriver
itself.

Signed-off-by: Cody Roseborough <crrosebo@amazon.com>
This commit is contained in:
Cody Roseborough 2018-03-02 20:05:28 +00:00
parent 135f815fb4
commit a1956b5623

View file

@ -93,7 +93,10 @@ func (r *RingLogger) Close() error {
} }
if err := r.l.Log(msg); err != nil { 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 logErr = true
} }
} }
@ -114,7 +117,10 @@ func (r *RingLogger) run() {
return return
} }
if err := r.l.Log(msg); err != nil { 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")
} }
} }
} }