From 67f8f6bb695681dceec6cee56520a28077c18bf9 Mon Sep 17 00:00:00 2001 From: Manu Mtz-Almeida Date: Tue, 7 Apr 2015 23:49:53 +0200 Subject: [PATCH] Captures the path before any middleware modifies it --- logger.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/logger.go b/logger.go index edb9723e..a0dedfeb 100644 --- a/logger.go +++ b/logger.go @@ -46,6 +46,7 @@ func LoggerWithFile(out io.Writer) HandlerFunc { return func(c *Context) { // Start timer start := time.Now() + path := c.Request.URL.Path // Process request c.Next() @@ -67,7 +68,7 @@ func LoggerWithFile(out io.Writer) HandlerFunc { latency, clientIP, methodColor, reset, method, - c.Request.URL.Path, + path, comment, ) }