mirror of
https://github.com/minio/minio.git
synced 2025-11-07 12:52:58 -05:00
Protect logger targets (#13529)
Logger targets were not race protected against concurrent updates from for example `HTTPConsoleLoggerSys`. Restrict direct access to targets and make slices immutable so a returned slice can be processed safely without locks.
This commit is contained in:
@@ -379,7 +379,7 @@ func logIf(ctx context.Context, err error, errKind ...interface{}) {
|
||||
}
|
||||
|
||||
// Iterate over all logger targets to send the log entry
|
||||
for _, t := range Targets {
|
||||
for _, t := range Targets() {
|
||||
t.Send(entry, entry.LogKind)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user