mirror of https://github.com/docker/docs.git
Fix race condition in JSONFileLogger.Log
Signed-off-by: Ingo Gottwald <in.gottwald@gmail.com>
This commit is contained in:
parent
9d6c2196b5
commit
f8c5420080
|
@ -90,6 +90,8 @@ func (l *JSONFileLogger) Log(msg *logger.Message) error {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
l.mu.Lock()
|
||||||
|
defer l.mu.Unlock()
|
||||||
err = (&jsonlog.JSONLogs{
|
err = (&jsonlog.JSONLogs{
|
||||||
Log: append(msg.Line, '\n'),
|
Log: append(msg.Line, '\n'),
|
||||||
Stream: msg.Source,
|
Stream: msg.Source,
|
||||||
|
|
Loading…
Reference in New Issue