mirror of
https://github.com/minio/minio.git
synced 2025-02-03 01:46:00 -05:00
fix: simplify error logged when logger target is unreachable (#20304)
This commit is contained in:
parent
fb4ad000b6
commit
9511056f44
@ -20,7 +20,6 @@ package logger
|
||||
import (
|
||||
"context"
|
||||
"encoding/hex"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"go/build"
|
||||
@ -422,9 +421,7 @@ func sendLog(ctx context.Context, entry log.Entry) {
|
||||
for _, t := range systemTgts {
|
||||
if err := t.Send(ctx, entry); err != nil {
|
||||
if consoleTgt != nil { // Sending to the console never fails
|
||||
b, _ := json.Marshal(entry)
|
||||
entry.Trace.Message = fmt.Sprintf("sendLog: event %s was not sent to Logger target (%v): %v", string(b), t.String(), err.Error())
|
||||
consoleTgt.Send(ctx, entry)
|
||||
consoleTgt.Send(ctx, errToEntry(ctx, "logging", fmt.Errorf("unable to send log event to Logger target (%s): %v", t.String(), err), entry.Level))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user