diff --git a/app/app/settings.py b/app/app/settings.py index 98dda2f8..46773ce6 100644 --- a/app/app/settings.py +++ b/app/app/settings.py @@ -234,7 +234,7 @@ def __contains__(self, address): DEFAULT_AUTO_FIELD = "django.db.models.BigAutoField" -LOGGING_FOLDER_DEFAULT = os.path.abspath(os.path.join("/logging/")) +LOGGING_DIR = Path("/logging") # Internationalization @@ -281,9 +281,7 @@ def __contains__(self, address): "file": { "level": os.environ.get("LOGGING_HANDLERS_LEVEL", "WARNING"), "class": "logging.FileHandler", - "filename": os.path.join( - LOGGING_FOLDER_DEFAULT, os.environ.get("LOGGING_FILE", "debug.log") - ), + "filename": LOGGING_DIR / os.environ.get("LOGGING_FILE", "debug.log"), "formatter": "verbose", }, }, diff --git a/app/general/tests/test_logging.py b/app/general/tests/test_logging.py index 00926204..b24d6ccb 100644 --- a/app/general/tests/test_logging.py +++ b/app/general/tests/test_logging.py @@ -1,15 +1,14 @@ import logging import os -import sys from django.test import TestCase class LoggingTest(TestCase): def setUp(self): - LOGGING_FOLDER_DEFAULT = os.path.abspath(os.path.join("/logging/")) + LOGGING_DIR = "/logging" self.logger = logging.getLogger("django") - self.log_file = os.path.join(LOGGING_FOLDER_DEFAULT, "debug.log") + self.log_file = os.path.join(LOGGING_DIR, "debug.log") def test_log_file_created(self): """Test if the log file is created."""