From a98d25b541504e9671c2652f9d20b1e0a362c51f Mon Sep 17 00:00:00 2001 From: Michael Puncel Date: Fri, 2 Oct 2015 18:33:06 -0700 Subject: [PATCH] Add http method to log output --- command/agent/http.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/command/agent/http.go b/command/agent/http.go index ddb2d7cd31..22f1c118eb 100644 --- a/command/agent/http.go +++ b/command/agent/http.go @@ -302,14 +302,14 @@ func (s *HTTPServer) wrap(handler func(resp http.ResponseWriter, req *http.Reque // Invoke the handler start := time.Now() defer func() { - s.logger.Printf("[DEBUG] http: Request %v (%v)", logURL, time.Now().Sub(start)) + s.logger.Printf("[DEBUG] http: Request %s %v (%v)", req.Method, logURL, time.Now().Sub(start)) }() obj, err := handler(resp, req) // Check for an error HAS_ERR: if err != nil { - s.logger.Printf("[ERR] http: Request %v, error: %v", logURL, err) + s.logger.Printf("[ERR] http: Request %s %v, error: %v", req.Method, logURL, err) code := 500 errMsg := err.Error() if strings.Contains(errMsg, "Permission denied") || strings.Contains(errMsg, "ACL not found") {