Fix race condition in JSONFileLogger.Log

Signed-off-by: Ingo Gottwald <in.gottwald@gmail.com>
Upstream-commit: f8c54200805a9b9088c90f0b46bfa848d7bae67c
Component: engine
This commit is contained in:
Ingo Gottwald
2016-01-03 22:45:56 +01:00
parent c32d38aa18
commit be7836d63c
@@ -90,6 +90,8 @@ func (l *JSONFileLogger) Log(msg *logger.Message) error {
if err != nil {
return err
}
l.mu.Lock()
defer l.mu.Unlock()
err = (&jsonlog.JSONLogs{
Log: append(msg.Line, '\n'),
Stream: msg.Source,