chore: add latency in log (#2374)

* Print profile.Data in boot log

* Add latency in request log
This commit is contained in:
Athurg Gooth 2023-10-10 19:03:32 +08:00 committed by GitHub
parent 95bfcb8055
commit d3e32f0d5a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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",
}))