diff options
| author | Sebastiaan van Stijn <github@gone.nl> | 2022-04-22 19:19:11 +0200 |
|---|---|---|
| committer | Sebastiaan van Stijn <github@gone.nl> | 2022-04-23 23:38:30 +0200 |
| commit | cd054983ff5bb51089117096f31b9aa50ec0d339 (patch) | |
| tree | e5bd31f2e1d4c719ed45f8e84e710bdd69d64cb4 /api/server | |
| parent | e78f6f9c68fee84430b76738c328d5b51d9c853a (diff) | |
| download | docker-cd054983ff5bb51089117096f31b9aa50ec0d339.tar.gz | |
api/server: remove "Logging" from config
The Logging boolean was unconditionally set to true and ignored in all locations,
except for enabling the debugging middleware, which was also gated by the active
logrus logging level.
While it could make sense to have a Loglevel option configured on the API server,
we don't have this currently, and to make that actually useful, that config would
need to be tollerated by all locations that produce logs (which isn't the case
either).
Looking at the history of this option; a boolean to disable logging was originally
added in commit c423a790d629b13c2eb1bc553beb3f61e30b3888, which hard-coded it to
"disabled" in a test, and "enabled" for the API server outside of tests (before
that commit, logging was always enabled).
02ddaad5d985186eed94dea4105a57fa21ba24db and 5c42b2b5122c1db08d229c258da26869b4d4d9cc
changed the hard-coded values to be configurable through a `Logging` env-var (env-
vars were used _internally_ at the time to pass on options), which later became
a configuration struct in a0bf80fe0372196812a9cb295f209c08f8037601.
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Diffstat (limited to 'api/server')
| -rw-r--r-- | api/server/middleware.go | 2 | ||||
| -rw-r--r-- | api/server/server.go | 1 |
2 files changed, 1 insertions, 2 deletions
diff --git a/api/server/middleware.go b/api/server/middleware.go index 3c5683fad9..10f3275bb1 100644 --- a/api/server/middleware.go +++ b/api/server/middleware.go @@ -16,7 +16,7 @@ func (s *Server) handlerWithGlobalMiddlewares(handler httputils.APIFunc) httputi next = m.WrapHandler(next) } - if s.cfg.Logging && logrus.GetLevel() == logrus.DebugLevel { + if logrus.GetLevel() == logrus.DebugLevel { next = middleware.DebugRequestMiddleware(next) } diff --git a/api/server/server.go b/api/server/server.go index 71dcb664c7..89c2902427 100644 --- a/api/server/server.go +++ b/api/server/server.go @@ -23,7 +23,6 @@ const versionMatcher = "/v{version:[0-9.]+}" // Config provides the configuration for the API server type Config struct { - Logging bool CorsHeaders string Version string SocketGroup string |
