fix: add LOG_DIR import and update log directory paths
Some checks failed
sync2gitee / repo-sync (push) Has been cancelled

This commit is contained in:
CaptainB 2025-06-21 22:42:46 +08:00
parent 23b47f24e7
commit 47a3489a0a
4 changed files with 5 additions and 6 deletions

View File

@ -2,7 +2,7 @@ import logging
import os
import sys
from maxkb.const import CONFIG, PROJECT_DIR
from maxkb.const import CONFIG, PROJECT_DIR, LOG_DIR
try:
from apps.maxkb import const
@ -19,7 +19,6 @@ HTTP_HOST = '0.0.0.0'
HTTP_PORT = CONFIG.HTTP_LISTEN_PORT or 8080
DEBUG = CONFIG.DEBUG or False
LOG_DIR = os.path.join(PROJECT_DIR, 'data', 'logs')
APPS_DIR = os.path.join(PROJECT_DIR, 'apps')
TMP_DIR = os.path.join(PROJECT_DIR, 'tmp')
if not os.path.exists(TMP_DIR):

View File

@ -9,6 +9,7 @@ from .conf import ConfigManager
__all__ = ['BASE_DIR', 'PROJECT_DIR', 'VERSION', 'CONFIG']
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
LOG_DIR = os.path.join('/', 'opt', 'maxkb', 'logs')
PROJECT_DIR = os.path.dirname(BASE_DIR)
VERSION = '2.0.0'

View File

@ -9,7 +9,7 @@
import os
import shutil
from maxkb.const import CONFIG, PROJECT_DIR
from maxkb.const import CONFIG, PROJECT_DIR, LOG_DIR
# celery相关配置
celery_data_dir = os.path.join(PROJECT_DIR, 'data', 'celery_task')
@ -45,4 +45,4 @@ CELERY_ONCE = {
'settings': {'location': celery_once_path}
}
CELERY_BROKER_CONNECTION_RETRY_ON_STARTUP = True
CELERY_LOG_DIR = os.path.join(PROJECT_DIR, 'logs', 'celery')
CELERY_LOG_DIR = os.path.join(LOG_DIR, 'celery')

View File

@ -2,9 +2,8 @@
#
import os
from ..const import PROJECT_DIR, CONFIG
from ..const import PROJECT_DIR, CONFIG, LOG_DIR
LOG_DIR = os.path.join(PROJECT_DIR, 'data', 'logs')
MAX_KB_LOG_FILE = os.path.join(LOG_DIR, 'max_kb.log')
DRF_EXCEPTION_LOG_FILE = os.path.join(LOG_DIR, 'drf_exception.log')
UNEXPECTED_EXCEPTION_LOG_FILE = os.path.join(LOG_DIR, 'unexpected_exception.log')