Skip to content

Commit

Permalink
fix(rpc): fixup auditlog logging twice
Browse files Browse the repository at this point in the history
close cubefs#2269

Signed-off-by: slasher <[email protected]>
  • Loading branch information
sejust committed Jul 11, 2023
1 parent 225fce6 commit b14a958
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions blobstore/common/rpc/auditlog/auditlog.go
Original file line number Diff line number Diff line change
Expand Up @@ -250,12 +250,10 @@ func (j *jsonAuditlog) Handler(w http.ResponseWriter, req *http.Request, f func(
}

switch j.cfg.LogFormat {
case LogFormatText:
logBytes = auditLog.ToBytesWithTab(b)
case LogFormatJSON:
logBytes = auditLog.ToJson()
default:
logBytes = auditLog.ToBytesWithTab(b)
logBytes = b.Bytes() // *bytes.Buffer was filled with metricSender.Send
}
err = j.logFile.Log(logBytes)
if err != nil {
Expand Down

0 comments on commit b14a958

Please sign in to comment.