Skip to content

Commit 0e3ae6a

Browse files
feat: add MAXKB_LOG_LEVEL env.
1 parent b06d568 commit 0e3ae6a

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

apps/maxkb/conf.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,9 @@ def get_cache_setting(self):
8181
def get_language_code(self):
8282
return self.get('LANGUAGE_CODE', 'zh-CN')
8383

84+
def get_log_level(self):
85+
return self.get('LOG_LEVEL', 'DEBUG')
86+
8487
def __init__(self, *args):
8588
super().__init__(*args)
8689

apps/maxkb/settings/logging.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
MAX_KB_LOG_FILE = os.path.join(LOG_DIR, 'maxkb.log')
88
DRF_EXCEPTION_LOG_FILE = os.path.join(LOG_DIR, 'drf_exception.log')
99
UNEXPECTED_EXCEPTION_LOG_FILE = os.path.join(LOG_DIR, 'unexpected_exception.log')
10-
LOG_LEVEL = "DEBUG"
10+
LOG_LEVEL = CONFIG.get_log_level()
1111

1212
LOGGING = {
1313
'version': 1,

installer/Dockerfile-base

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,5 @@ ENV PGDATA=/opt/maxkb/data/postgresql/pgdata \
3131
POSTGRES_PASSWORD=Password123@postgres \
3232
POSTGRES_MAX_CONNECTIONS=1000 \
3333
REDIS_PASSWORD=Password123@redis \
34-
LANG=en_US.UTF-8
34+
LANG=en_US.UTF-8 \
35+
MAXKB_LOG_LEVEL=INFO

0 commit comments

Comments
 (0)