Skip to content

Commit

Permalink
bugfix: SetSlowThreshold not effective in function logDetails
Browse files Browse the repository at this point in the history
  • Loading branch information
Star Wang authored and kevwan committed Dec 21, 2024
1 parent 8f9ba3e commit 854ee80
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion rest/handler/loghandler.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ func logDetails(r *http.Request, response *detailLoggedResponseWriter, timer *ut
logger := logx.WithContext(r.Context())
buf.WriteString(fmt.Sprintf("[HTTP] %s - %d - %s - %s\n=> %s\n",
r.Method, code, r.RemoteAddr, timex.ReprOfDuration(duration), dumpRequest(r)))
if duration > defaultSlowThreshold {
if duration > slowThreshold.Load() {
logger.Slowf("[HTTP] %s - %d - %s - slowcall(%s)\n=> %s\n", r.Method, code, r.RemoteAddr,
fmt.Sprintf("slowcall(%s)", timex.ReprOfDuration(duration)), dumpRequest(r))
}
Expand Down

0 comments on commit 854ee80

Please sign in to comment.