Fix race condition in JSONFileLogger.Log
Signed-off-by: Ingo Gottwald <in.gottwald@gmail.com>
This commit is contained in:
parent
9d6c2196b5
commit
f8c5420080
1 changed files with 2 additions and 0 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Reference in a new issue