Log request URI rather than path.
This commit is contained in:
parent
a70003d290
commit
5e9e502b42
3 changed files with 8 additions and 9 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue