Skip to content

Commit

Permalink
fix: Change the WriteSyncer to use lock when piping (#1608)
Browse files Browse the repository at this point in the history
## Relevant issue(s)

Resolves #1607

## Description

This PR wraps the pipe WriteSyncer with a Lock so that is can be used
concurrently.
  • Loading branch information
fredcarle authored Jul 4, 2023
1 parent 97873c5 commit 5f4beb9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion logging/logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ func buildZapLogger(name string, config Config) (*zap.Logger, error) {
cfg.EncodeLevel = defaultConfig.EncoderConfig.EncodeLevel
return zapcore.NewCore(
zapcore.NewJSONEncoder(cfg),
zapcore.AddSync(config.pipe),
zapcore.Lock(zapcore.AddSync(config.pipe)),
zap.NewAtomicLevelAt(zapcore.Level(config.Level.LogLevel)),
)
}))
Expand Down

0 comments on commit 5f4beb9

Please sign in to comment.