Skip to content

Commit ba1c502

Browse files
committed
dont print if body is empty
1 parent cf14ef7 commit ba1c502

File tree

1 file changed

+5
-1
lines changed
  • internals/proxy/middlewares

1 file changed

+5
-1
lines changed

internals/proxy/middlewares/log.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,11 @@ func loggingHandler(next http.Handler) http.Handler {
1919
} else {
2020
body, _ := request.GetReqBody(req)
2121

22-
log.Dev(req.Method, " ", req.URL.Path, " ", req.URL.RawQuery, body.Data)
22+
if body.Data != nil && !body.Empty {
23+
log.Dev(req.Method, " ", req.URL.Path, " ", req.URL.RawQuery, body.Data)
24+
} else {
25+
log.Dev(req.Method, " ", req.URL.Path, " ", req.URL.RawQuery)
26+
}
2327
}
2428

2529
next.ServeHTTP(w, req)

0 commit comments

Comments
 (0)