chore(http): set log level to trace (#765)

This commit is contained in:
Kyle Sanderson 2023-03-19 14:01:43 -07:00 committed by GitHub
parent 4ade1b0ecf
commit 0d6e23f278
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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)