From ccad9eb9bc87b09de668eee8d9fb56aefc8862f9 Mon Sep 17 00:00:00 2001 From: steve-chavez Date: Mon, 5 Oct 2020 20:22:31 -0500 Subject: [PATCH] Change default log-level, from info to error --- CHANGELOG.md | 1 + src/PostgREST/Config.hs | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b2014f295..b28fb6b8c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,6 +26,7 @@ This project adheres to [Semantic Versioning](http://semver.org/). - #1522, #1528, #1535, Docker images are now built from scratch based on a the static PostgREST executable (#1494) and with Nix instead of a `Dockerfile`. This reduces the compressed image size from over 30mb to about 4mb - @monacoremo - #1475, Location header for POST request is only included when PK is available on the table (#1461) - @wolfgangwalther - #1560, Volatile RPC called with GET now returns 405 Method not Allowed instead of 500 - @wolfgangwalther + - #1604, Change the default logging level to `log-level=error`. Only requests with a status greater or equal than 500 will be logged. If you wish to go back to the previous behaviour and log all the requests, use `log-level=info` - @steve-chavez ## [7.0.1] - 2020-05-18 diff --git a/src/PostgREST/Config.hs b/src/PostgREST/Config.hs index 627cf7cfc..30dad48cc 100644 --- a/src/PostgREST/Config.hs +++ b/src/PostgREST/Config.hs @@ -195,7 +195,7 @@ readPathShowHelp = customExecParser parserPrefs opts |# raw-media-types="image/png, image/jpg" | |## logging level, the admitted values are: crit, error, warn and info. - |# log-level = "info" + |# log-level = "error" |] -- | Parse the config file @@ -266,8 +266,8 @@ readAppConfig cfgPath = do parseLogLevel :: C.Key -> C.Parser C.Config LogLevel parseLogLevel k = C.optional k C.string >>= \case - Nothing -> pure LogInfo - Just "" -> pure LogInfo + Nothing -> pure LogError + Just "" -> pure LogError Just "crit" -> pure LogCrit Just "error" -> pure LogError Just "warn" -> pure LogWarn