diff --git a/app/utils/logging.py b/app/utils/logging.py index c7290e6..404ce01 100644 --- a/app/utils/logging.py +++ b/app/utils/logging.py @@ -4,8 +4,10 @@ import os import shutil from logging.handlers import TimedRotatingFileHandler from datetime import datetime, timedelta +from config import Config -LOG_DIR = app.config['LOG_DIR'] +#LOG_DIR = app.config['LOG_DIR'] +LOG_DIR = Config.LOG_DIR os.makedirs(LOG_DIR, exist_ok=True) def cleanup_old_log_dirs(max_age_days=90): diff --git a/config.py b/config.py index e809359..83dc1cf 100644 --- a/config.py +++ b/config.py @@ -3,6 +3,6 @@ import os class Config: SECRET_KEY = os.environ.get('SECRET_KEY') or 'dev-key-change-me' - CONFIG_DIR = 'configs' - LOG_DIR = 'logs' - SOUNDS_DIR = 'sounds' \ No newline at end of file + CONFIG_DIR = os.path.join(os.path.dirname(__file__), '..', 'configs') + LOG_DIR = os.path.join(os.path.dirname(__file__), '..', 'logs') + SOUNDS_DIR = os.path.join(os.path.dirname(__file__), '..', 'sounds') \ No newline at end of file