mirror of
https://github.com/gotenberg/gotenberg.git
synced 2026-08-14 11:22:15 +01:00
New environment variables : DISABLE_HEALTHCHECK_LOGGING and DEFAULT_LISTEN_PORT (#78)
* skip logging when healthcheck url is called; closes #74 (#75) Signed-off-by: Casey Kuhlman <casey@monax.io> * Configure listen port via environment variable (#77) * skip logging when healthcheck url is called; closes #74 Signed-off-by: Casey Kuhlman <casey@monax.io> * skip logging when healthcheck url is called; closes #74 Signed-off-by: Casey Kuhlman <casey@monax.io> * adds the ability to establish the listen port via env var Signed-off-by: Casey Kuhlman <casey@monax.io> * minor refactoring of @compleatang work * fixing typo
This commit is contained in:
@@ -6,8 +6,22 @@ import (
|
||||
"strings"
|
||||
|
||||
"github.com/labstack/echo/v4"
|
||||
"github.com/labstack/echo/v4/middleware"
|
||||
)
|
||||
|
||||
func handleLogging(enableHealthcheckLogging bool) echo.MiddlewareFunc {
|
||||
if enableHealthcheckLogging {
|
||||
// default logging middleware.
|
||||
return middleware.Logger()
|
||||
}
|
||||
// middleware for skipping logging when the ping endpoint is called.
|
||||
return middleware.LoggerWithConfig(middleware.LoggerConfig{
|
||||
Skipper: func(c echo.Context) bool {
|
||||
return c.Request().URL.Path == pingEndpoint
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
func handleContext(opts *Options) echo.MiddlewareFunc {
|
||||
// middleware for extending default context with our
|
||||
// custom constext.
|
||||
|
||||
Reference in New Issue
Block a user