From 579bc1c2c8319df3c4bf95eca85c546c03fdd3be Mon Sep 17 00:00:00 2001 From: Piotr Popieluch Date: Thu, 3 Dec 2015 09:23:14 +0100 Subject: [PATCH] Add more info in route logging - Add remote address - Add method - Add protocol - Add response size - Use consistent unit for response time (us) --- pkg/middleware/logger.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/middleware/logger.go b/pkg/middleware/logger.go index eb5c7b8dde4..4b8e1f06bae 100644 --- a/pkg/middleware/logger.go +++ b/pkg/middleware/logger.go @@ -32,7 +32,7 @@ func Logger() macaron.Handler { rw := res.(macaron.ResponseWriter) c.Next() - content := fmt.Sprintf("Completed %s %v %s in %v", req.URL.Path, rw.Status(), http.StatusText(rw.Status()), time.Since(start)) + content := fmt.Sprintf("Completed %s \"%s %s %s\" %v %s %d bytes in %dus", c.RemoteAddr(), req.Method, req.URL.Path, req.Proto, rw.Status(), http.StatusText(rw.Status()), rw.Size(), time.Since(start)/time.Microsecond) switch rw.Status() { case 200, 304: