From d3e32f0d5abeb5fadb95b31f1fe0e1aa91e137b2 Mon Sep 17 00:00:00 2001 From: Athurg Gooth Date: Tue, 10 Oct 2023 19:03:32 +0800 Subject: [PATCH] chore: add latency in log (#2374) * Print profile.Data in boot log * Add latency in request log --- server/server.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/server.go b/server/server.go index d8a6f35e..326c2770 100644 --- a/server/server.go +++ b/server/server.go @@ -59,7 +59,7 @@ func NewServer(ctx context.Context, profile *profile.Profile, store *store.Store } e.Use(middleware.LoggerWithConfig(middleware.LoggerConfig{ - Format: `{"time":"${time_rfc3339}",` + + Format: `{"time":"${time_rfc3339}","latency":"${latency_human}",` + `"method":"${method}","uri":"${uri}",` + `"status":${status},"error":"${error}"}` + "\n", }))