mirror of
https://github.com/minio/minio.git
synced 2025-02-13 06:38:09 -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 (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"encoding/hex"
|
"encoding/hex"
|
||||||
"encoding/json"
|
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"go/build"
|
"go/build"
|
||||||
@ -422,9 +421,7 @@ func sendLog(ctx context.Context, entry log.Entry) {
|
|||||||
for _, t := range systemTgts {
|
for _, t := range systemTgts {
|
||||||
if err := t.Send(ctx, entry); err != nil {
|
if err := t.Send(ctx, entry); err != nil {
|
||||||
if consoleTgt != nil { // Sending to the console never fails
|
if consoleTgt != nil { // Sending to the console never fails
|
||||||
b, _ := json.Marshal(entry)
|
consoleTgt.Send(ctx, errToEntry(ctx, "logging", fmt.Errorf("unable to send log event to Logger target (%s): %v", t.String(), err), entry.Level))
|
||||||
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)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user