feat: add MAXKB_LOG_LEVEL env.

This commit is contained in:
liqiang-fit2cloud 2025-06-25 16:05:02 +08:00
parent b06d5685f2
commit 0e3ae6a8f8
3 changed files with 6 additions and 2 deletions

View File

@ -81,6 +81,9 @@ class Config(dict):
def get_language_code(self):
return self.get('LANGUAGE_CODE', 'zh-CN')
def get_log_level(self):
return self.get('LOG_LEVEL', 'DEBUG')
def __init__(self, *args):
super().__init__(*args)

View File

@ -7,7 +7,7 @@ from ..const import PROJECT_DIR, CONFIG, LOG_DIR
MAX_KB_LOG_FILE = os.path.join(LOG_DIR, 'maxkb.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')
LOG_LEVEL = "DEBUG"
LOG_LEVEL = CONFIG.get_log_level()
LOGGING = {
'version': 1,

View File

@ -31,4 +31,5 @@ ENV PGDATA=/opt/maxkb/data/postgresql/pgdata \
POSTGRES_PASSWORD=Password123@postgres \
POSTGRES_MAX_CONNECTIONS=1000 \
REDIS_PASSWORD=Password123@redis \
LANG=en_US.UTF-8
LANG=en_US.UTF-8 \
MAXKB_LOG_LEVEL=INFO