Log request URI rather than path.

This commit is contained in:
mikestefanello 2024-06-19 09:32:22 -04:00
parent a70003d290
commit 5e9e502b42
3 changed files with 8 additions and 9 deletions

View file

@ -59,13 +59,7 @@ func LogRequest() echo.MiddlewareFunc {
"latency", stop.Sub(start).String(),
)
msg := fmt.Sprintf("%s %s", req.Method, func() string {
p := req.URL.Path
if p == "" {
p = "/"
}
return p
}())
msg := fmt.Sprintf("%s %s", req.Method, req.URL.RequestURI())
if res.Status >= 500 {
sub.Error(msg)