Captures the path before any middleware modifies it

This commit is contained in:
Manu Mtz-Almeida 2015-04-07 23:49:53 +02:00
parent 9355274051
commit 67f8f6bb69

View File

@ -46,6 +46,7 @@ func LoggerWithFile(out io.Writer) HandlerFunc {
return func(c *Context) { return func(c *Context) {
// Start timer // Start timer
start := time.Now() start := time.Now()
path := c.Request.URL.Path
// Process request // Process request
c.Next() c.Next()
@ -67,7 +68,7 @@ func LoggerWithFile(out io.Writer) HandlerFunc {
latency, latency,
clientIP, clientIP,
methodColor, reset, method, methodColor, reset, method,
c.Request.URL.Path, path,
comment, comment,
) )
} }