From 99eab744c08cbd72cc5196845dcd1ad67068203e Mon Sep 17 00:00:00 2001 From: David Irvine Date: Tue, 21 Jun 2016 07:47:03 -0500 Subject: [PATCH] Add missing user identifier part --- commonlog/commonlog.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/commonlog/commonlog.go b/commonlog/commonlog.go index a02a8a8..753110b 100644 --- a/commonlog/commonlog.go +++ b/commonlog/commonlog.go @@ -26,8 +26,6 @@ func NewWithWriter(out io.Writer) gin.HandlerFunc { }, } return func(c *gin.Context) { - path := c.Request.URL.Path - // Process request c.Next() @@ -35,12 +33,12 @@ func NewWithWriter(out io.Writer) gin.HandlerFunc { w := pool.Get().(*bytes.Buffer) w.Reset() w.WriteString(c.ClientIP()) - w.WriteString(" ") + w.WriteString(" - - ") w.WriteString(time.Now().Format("[02/Jan/2006:15:04:05 -0700] ")) w.WriteString("\"") w.WriteString(c.Request.Method) w.WriteString(" ") - w.WriteString(path) + w.WriteString(c.Request.URL.Path) w.WriteString(" ") w.WriteString(c.Request.Proto) w.WriteString("\" ")