diff --git a/CHANGELOG.md b/CHANGELOG.md index 8f7776f6..9a927840 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,23 +11,23 @@ and this project adheres to ## Added +- 🌐(backend) add german translation #259 - 🌐(frontend) Add German translation #255 - ✨(frontend) Add a broadcast store #387 - ✨(backend) config endpoint #425 - ## Changed - 🚸(backend) improve users similarity search and sort results #391 -- 🌐(backend) add german translation #259 - ♻️(frontend) simplify stores #402 - ✨(frontend) update $css Box props type to add styled components RuleSet #423 ## Fixed +- 🔧(backend) fix logging for docker and make it configurable by envar #427 - 🦺(backend) add comma to sub regex #408 - 🐛(editor) collaborative user tag hidden when read only #385 -- 🐛(frontend) user have view access when revoked #387 +- 🐛(frontend) users have view access when revoked #387 ## [1.7.0] - 2024-10-24 diff --git a/env.d/development/common.dist b/env.d/development/common.dist index 95c8f8f7..a52e45ad 100644 --- a/env.d/development/common.dist +++ b/env.d/development/common.dist @@ -4,6 +4,12 @@ DJANGO_SECRET_KEY=ThisIsAnExampleKeyForDevPurposeOnly DJANGO_SETTINGS_MODULE=impress.settings DJANGO_SUPERUSER_PASSWORD=admin +# Logging +# Set to DEBUG level for dev only +LOGGING_LEVEL_HANDLERS_CONSOLE=INFO +LOGGING_LEVEL_LOGGERS_ROOT=INFO +LOGGING_LEVEL_LOGGERS_APP=INFO + # Python PYTHONPATH=/app diff --git a/src/backend/impress/settings.py b/src/backend/impress/settings.py index 5e0c60c4..ccf81130 100755 --- a/src/backend/impress/settings.py +++ b/src/backend/impress/settings.py @@ -488,6 +488,42 @@ class Base(Configuration): environ_prefix=None, ) + # Logging + # We want to make it easy to log to console but by default we log production + # to Sentry and don't want to log to console. + LOGGING = { + "version": 1, + "disable_existing_loggers": False, + "handlers": { + "console": { + "class": "logging.StreamHandler", + "level": values.Value( + "ERROR", + environ_name="LOGGING_LEVEL_HANDLERS_CONSOLE", + environ_prefix=None, + ), + }, + }, + # Override root logger to send it to console + "root": { + "handlers": ["console"], + "level": values.Value( + "INFO", environ_name="LOGGING_LEVEL_LOGGERS_ROOT", environ_prefix=None + ), + }, + "loggers": { + "core": { + "handlers": ["console"], + "level": values.Value( + "INFO", + environ_name="LOGGING_LEVEL_LOGGERS_APP", + environ_prefix=None, + ), + "propagate": False, + }, + }, + } + # pylint: disable=invalid-name @property def ENVIRONMENT(self): @@ -583,23 +619,6 @@ class Development(Base): class Test(Base): """Test environment settings""" - LOGGING = values.DictValue( - { - "version": 1, - "disable_existing_loggers": False, - "handlers": { - "console": { - "class": "logging.StreamHandler", - }, - }, - "loggers": { - "impress": { - "handlers": ["console"], - "level": "DEBUG", - }, - }, - } - ) PASSWORD_HASHERS = [ "django.contrib.auth.hashers.MD5PasswordHasher", ] diff --git a/src/helm/env.d/dev/values.impress.yaml.gotmpl b/src/helm/env.d/dev/values.impress.yaml.gotmpl index 8f34286c..96d29c93 100644 --- a/src/helm/env.d/dev/values.impress.yaml.gotmpl +++ b/src/helm/env.d/dev/values.impress.yaml.gotmpl @@ -15,6 +15,9 @@ backend: DJANGO_EMAIL_HOST: "mailcatcher" DJANGO_EMAIL_PORT: 1025 DJANGO_EMAIL_USE_SSL: False + LOGGING_LEVEL_HANDLERS_CONSOLE: ERROR + LOGGING_LEVEL_LOGGERS_ROOT: INFO + LOGGING_LEVEL_LOGGERS_APP: INFO OIDC_OP_JWKS_ENDPOINT: https://fca.integ01.dev-agentconnect.fr/api/v2/jwks OIDC_OP_AUTHORIZATION_ENDPOINT: https://fca.integ01.dev-agentconnect.fr/api/v2/authorize OIDC_OP_TOKEN_ENDPOINT: https://fca.integ01.dev-agentconnect.fr/api/v2/token