Skip to content

Commit 47a3489

Browse files
committed
fix: add LOG_DIR import and update log directory paths
1 parent 23b47f2 commit 47a3489

File tree

4 files changed

+5
-6
lines changed

4 files changed

+5
-6
lines changed

apps/common/management/commands/services/hands.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import os
33
import sys
44

5-
from maxkb.const import CONFIG, PROJECT_DIR
5+
from maxkb.const import CONFIG, PROJECT_DIR, LOG_DIR
66

77
try:
88
from apps.maxkb import const
@@ -19,7 +19,6 @@
1919
HTTP_PORT = CONFIG.HTTP_LISTEN_PORT or 8080
2020
DEBUG = CONFIG.DEBUG or False
2121

22-
LOG_DIR = os.path.join(PROJECT_DIR, 'data', 'logs')
2322
APPS_DIR = os.path.join(PROJECT_DIR, 'apps')
2423
TMP_DIR = os.path.join(PROJECT_DIR, 'tmp')
2524
if not os.path.exists(TMP_DIR):

apps/maxkb/const.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
__all__ = ['BASE_DIR', 'PROJECT_DIR', 'VERSION', 'CONFIG']
1010

1111
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
12+
LOG_DIR = os.path.join('/', 'opt', 'maxkb', 'logs')
1213
PROJECT_DIR = os.path.dirname(BASE_DIR)
1314
VERSION = '2.0.0'
1415

apps/maxkb/settings/lib.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
import os
1010
import shutil
1111

12-
from maxkb.const import CONFIG, PROJECT_DIR
12+
from maxkb.const import CONFIG, PROJECT_DIR, LOG_DIR
1313

1414
# celery相关配置
1515
celery_data_dir = os.path.join(PROJECT_DIR, 'data', 'celery_task')
@@ -45,4 +45,4 @@
4545
'settings': {'location': celery_once_path}
4646
}
4747
CELERY_BROKER_CONNECTION_RETRY_ON_STARTUP = True
48-
CELERY_LOG_DIR = os.path.join(PROJECT_DIR, 'logs', 'celery')
48+
CELERY_LOG_DIR = os.path.join(LOG_DIR, 'celery')

apps/maxkb/settings/logging.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,8 @@
22
#
33
import os
44

5-
from ..const import PROJECT_DIR, CONFIG
5+
from ..const import PROJECT_DIR, CONFIG, LOG_DIR
66

7-
LOG_DIR = os.path.join(PROJECT_DIR, 'data', 'logs')
87
MAX_KB_LOG_FILE = os.path.join(LOG_DIR, 'max_kb.log')
98
DRF_EXCEPTION_LOG_FILE = os.path.join(LOG_DIR, 'drf_exception.log')
109
UNEXPECTED_EXCEPTION_LOG_FILE = os.path.join(LOG_DIR, 'unexpected_exception.log')

0 commit comments

Comments
 (0)