diff options
Diffstat (limited to 'echo/echo_default.go')
-rw-r--r-- | echo/echo_default.go | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/echo/echo_default.go b/echo/echo_default.go index 8d5e1a9..9f7e19e 100644 --- a/echo/echo_default.go +++ b/echo/echo_default.go | |||
@@ -93,7 +93,25 @@ func NewEchoWrapper(ctx context.Context, debug bool) (*EchoWrapper, error) { | |||
93 | e.Logger.SetLevel(log.DEBUG) | 93 | e.Logger.SetLevel(log.DEBUG) |
94 | } | 94 | } |
95 | 95 | ||
96 | e.Use(middleware.Logger()) | 96 | e.Use(glmw.JsonLoggerWithConfig(glmw.JsonLoggerConfig{ |
97 | Format: map[string]string{ | ||
98 | "time": "time_rfc3339_nano", | ||
99 | "id": "id", | ||
100 | "remote_ip": "remote_ip", | ||
101 | "host": "host", | ||
102 | "method": "method", | ||
103 | "uri": "uri", | ||
104 | "user_agent": "user_agent", | ||
105 | "status": "status", | ||
106 | "error": "error", | ||
107 | "latency": "latency", | ||
108 | "latency_human": "latency_human", | ||
109 | "bytes_in": "bytes_in", | ||
110 | "bytes_out": "bytes_out", | ||
111 | "protocol": "protocol", | ||
112 | }, | ||
113 | Output: e.Logger.Output(), | ||
114 | })) | ||
97 | e.Use(glmw.Recover()) | 115 | e.Use(glmw.Recover()) |
98 | 116 | ||
99 | return &EchoWrapper{ | 117 | return &EchoWrapper{ |