From 4a86175a32712055a9fd1f6cd55665ad04e3d67b Mon Sep 17 00:00:00 2001 From: Vishal Rana Date: Fri, 18 Mar 2016 20:40:41 -0700 Subject: [PATCH] Logger format Signed-off-by: Vishal Rana --- middleware/logger.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/middleware/logger.go b/middleware/logger.go index ab8d14e3..267fdcef 100644 --- a/middleware/logger.go +++ b/middleware/logger.go @@ -21,7 +21,7 @@ type ( var ( DefaultLoggerConfig = LoggerConfig{ - Format: "[${time}] ${remote_ip} ${method} ${path} ${status} ${response_time} ${size}\n", + Format: "time=${time_rfc3339}, remote_ip=${remote_ip}, method=${method}, path=${path}, status=${status}, response_time=${response_time}, size=${size}\n", } ) @@ -74,7 +74,7 @@ func LoggerFromConfig(config LoggerConfig) echo.MiddlewareFunc { _, err = config.template.ExecuteFunc(output, func(w io.Writer, tag string) (int, error) { switch tag { case "time_rfc3339": - return w.Write([]byte(time.Now().Format(time.Stamp))) + return w.Write([]byte(time.Now().Format(time.RFC3339))) case "remote_ip": return w.Write([]byte(remoteAddr)) case "method":