mirror of
https://github.com/labstack/echo.git
synced 2025-01-12 01:22:21 +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 (
|
var (
|
||||||
DefaultLoggerConfig = LoggerConfig{
|
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) {
|
_, err = config.template.ExecuteFunc(output, func(w io.Writer, tag string) (int, error) {
|
||||||
switch tag {
|
switch tag {
|
||||||
case "time_rfc3339":
|
case "time_rfc3339":
|
||||||
return w.Write([]byte(time.Now().Format(time.Stamp)))
|
return w.Write([]byte(time.Now().Format(time.RFC3339)))
|
||||||
case "remote_ip":
|
case "remote_ip":
|
||||||
return w.Write([]byte(remoteAddr))
|
return w.Write([]byte(remoteAddr))
|
||||||
case "method":
|
case "method":
|
||||||
|
Loading…
Reference in New Issue
Block a user