From 0c837416e1b9689cb8c86b4d7b7575092e0bea06 Mon Sep 17 00:00:00 2001 From: Thomas Rusiecki Date: Mon, 9 Dec 2024 18:37:53 -0300 Subject: [PATCH] made log var a env variable --- .env.example | 1 + dhub/settings.py | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.env.example b/.env.example index ed60e95..935710c 100644 --- a/.env.example +++ b/.env.example @@ -4,6 +4,7 @@ DEMO=true DEBUG=true ALLOWED_HOSTS=localhost,localhost:8000,127.0.0.1, +DEVICE_LOG_PATH=/tmp STATIC_ROOT=/tmp/static/ MEDIA_ROOT=/tmp/media/ EMAIL_HOST="mail.example.org" diff --git a/dhub/settings.py b/dhub/settings.py index 433c057..0ad95f8 100644 --- a/dhub/settings.py +++ b/dhub/settings.py @@ -65,6 +65,8 @@ ENABLE_EMAIL = config("ENABLE_EMAIL", default=True, cast=bool) EVIDENCES_DIR = config("EVIDENCES_DIR", default=os.path.join(BASE_DIR, "db")) +DEVICE_LOG_PATH = config("DEVICE_LOG_PATH", default="/tmp") + # Application definition INSTALLED_APPS = [ @@ -224,7 +226,7 @@ LOGGING = { 'device_log_file': { 'level': 'INFO', 'class': 'logging.FileHandler', - 'filename': '/var/log/device_changes.log', + 'filename': DEVICE_LOG_PATH + "/device_changes.log", 'formatter': 'verbose', }, },