chore: update logger

This commit is contained in:
Steven
2022-08-19 00:45:02 +08:00
parent ce390f3f79
commit e3fac742c5
2 changed files with 9 additions and 14 deletions

View File

@ -29,7 +29,9 @@ func NewServer(profile *profile.Profile) *Server {
e.HidePort = true
e.Use(middleware.LoggerWithConfig(middleware.LoggerConfig{
Format: "${method} ${uri} ${status}\n",
Format: `{"time":"${time_rfc3339}",` +
`"method":"${method}","uri":"${uri}",` +
`"status":${status},"error":"${error}"}` + "\n",
}))
e.Use(middleware.CORS())