mirror of
https://github.com/labstack/echo.git
synced 2024-12-24 20:14:31 +02:00
Logger format
Signed-off-by: Vishal Rana <vr@labstack.com>
This commit is contained in:
parent
abf389f91a
commit
4a86175a32
@ -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":
|
||||
|
Loading…
Reference in New Issue
Block a user