Fix race condition in JSONFileLogger.Log

Signed-off-by: Ingo Gottwald <in.gottwald@gmail.com>
This commit is contained in:
Ingo Gottwald 2016-01-03 22:45:56 +01:00
parent 9d6c2196b5
commit f8c5420080

View file

@ -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,