mirror of
https://github.com/idanoo/autobrr
synced 2025-07-23 08:49:13 +00:00
chore(http): set log level to trace (#765)
This commit is contained in:
parent
4ade1b0ecf
commit
0d6e23f278
1 changed files with 19 additions and 16 deletions
|
@ -3,6 +3,7 @@ package http
|
|||
import (
|
||||
"net/http"
|
||||
"runtime/debug"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/go-chi/chi/v5/middleware"
|
||||
|
@ -61,8 +62,9 @@ func LoggerMiddleware(logger *zerolog.Logger) func(next http.Handler) http.Handl
|
|||
http.Error(ww, http.StatusText(http.StatusInternalServerError), http.StatusInternalServerError)
|
||||
}
|
||||
|
||||
if !strings.Contains("/api/healthz/liveness|/api/healthz/readiness", r.URL.Path) {
|
||||
// log end request
|
||||
log.Info().
|
||||
log.Trace().
|
||||
Str("type", "access").
|
||||
Timestamp().
|
||||
Fields(map[string]interface{}{
|
||||
|
@ -77,6 +79,7 @@ func LoggerMiddleware(logger *zerolog.Logger) func(next http.Handler) http.Handl
|
|||
"bytes_out": ww.BytesWritten(),
|
||||
}).
|
||||
Msg("incoming_request")
|
||||
}
|
||||
}()
|
||||
|
||||
next.ServeHTTP(ww, r)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue