From 827a4661e27d084d01ef6043b9007c72e86a352d Mon Sep 17 00:00:00 2001 From: Rishi Garg Date: Sat, 22 Feb 2025 13:30:07 +0530 Subject: [PATCH] Log directory changed to /var/log/ Signed-off-by: Rishi Garg --- vulnerablecode/settings.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/vulnerablecode/settings.py b/vulnerablecode/settings.py index 0e545e0f2..7641d1630 100644 --- a/vulnerablecode/settings.py +++ b/vulnerablecode/settings.py @@ -7,6 +7,7 @@ # See https://aboutcode.org for more information about nexB OSS projects. # +import os import sys from pathlib import Path @@ -322,6 +323,8 @@ "127.0.0.1", ] +LOG_DIR = env.str("VULNERABLECODE_LOG_DIR", "/var/log/vulnerablecode") +os.makedirs(LOG_DIR, exist_ok=True) LOGGING = { "version": 1, @@ -340,6 +343,13 @@ "class": "logging.StreamHandler", "formatter": "simple", }, + "file": { + "class": "logging.handlers.RotatingFileHandler", + "filename": os.path.join(LOG_DIR, "vulnerablecode.log"), + "formatter": "simple", + "maxBytes": 10485760, + "backupCount": 5, + }, }, "loggers": { "vulnerabilities.pipelines": {