From 6f33e5ae889a3ad05a3eb29e9b149d9e1321042f Mon Sep 17 00:00:00 2001 From: Adam Setters <9741640+asetty@users.noreply.github.com> Date: Fri, 23 Oct 2020 18:49:38 -0400 Subject: [PATCH] Add host and HTTP method to request log Signed-off-by: Adam Setters --- util.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/util.go b/util.go index 27199740..0d9d1d9a 100644 --- a/util.go +++ b/util.go @@ -34,8 +34,10 @@ func realpath(path string) (string, error) { func loggerForRequest(r *http.Request) *log.Entry { return log.WithContext(r.Context()).WithFields(log.Fields{ - "ip": getUserIP(r), - "request": r.URL.String(), + "ip": getUserIP(r), + "host": r.Host, + "path": r.URL.String(), + "method": r.Method, }) }