Set dbcleanup.log location configurable

This commit is contained in:
Óscar García Amor
2025-11-03 14:13:19 +01:00
committed by Joel Krauska
parent 74369deaea
commit 4de92da1ae
2 changed files with 3 additions and 1 deletions

View File

@@ -109,3 +109,5 @@ vacuum = False
# Application logs (errors, startup messages, etc.) are unaffected
# Set to True to enable, False to disable (default: False)
access_log = False
# Database cleanup logfile
db_cleanup_logfile = dbcleanup.log

View File

@@ -13,7 +13,7 @@ from meshview.config import CONFIG
# -------------------------
cleanup_logger = logging.getLogger("dbcleanup")
cleanup_logger.setLevel(logging.INFO)
file_handler = logging.FileHandler("dbcleanup.log")
file_handler = logging.FileHandler(CONFIG["logging"]["db_cleanup_logfile"])
file_handler.setLevel(logging.INFO)
formatter = logging.Formatter('%(asctime)s [%(levelname)s] %(message)s')
file_handler.setFormatter(formatter)