diff --git a/pkg/web/api.go b/pkg/web/api.go index e516317f..88e73ba5 100644 --- a/pkg/web/api.go +++ b/pkg/web/api.go @@ -168,7 +168,19 @@ func newEcho(targetFactory target.Factory) *echo.Echo { observability.Initialize() e.Use(middleware.Recover()) - e.Use(middleware.Logger()) + e.Use(middleware.LoggerWithConfig(middleware.LoggerConfig{ + Skipper: func(c echo.Context) bool { + if c.Path() == "/healthcheck" || c.Path() == "/metrics" { + return true + } + return false + }, + Format: `{"time":"${time_rfc3339_nano}","id":"${id}","remote_ip":"${remote_ip}",` + + `"host":"${host}","method":"${method}","uri":"${uri}","user_agent":"${user_agent}",` + + `"status":${status},"error":"${error}","latency":${latency},"latency_human":"${latency_human}"` + + `,"bytes_in":${bytes_in},"bytes_out":${bytes_out}}` + "\n", + CustomTimeFormat: "2006-01-02 15:04:05.00000", + })) e.Use(metricsMiddleware) e.Use(observability.OpenTracingMiddleware) e.Use(middleware.BasicAuthWithConfig(middleware.BasicAuthConfig{