From b7b42b585467c06513f31cbb88e5a62508b18ab8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=AC=A2=E4=B9=90=E9=A9=AC?= <38058090+SkywalkerSpace@users.noreply.github.com> Date: Wed, 25 Dec 2024 22:15:32 +0800 Subject: [PATCH] update SEAFILE_LOG_TO_STDOUT (#7256) --- scripts/seafile.sh | 6 +++++- scripts/seahub.sh | 2 +- seahub/settings.py | 8 ++------ 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/scripts/seafile.sh b/scripts/seafile.sh index 9b8b6a8cb3..9a02a836bf 100755 --- a/scripts/seafile.sh +++ b/scripts/seafile.sh @@ -175,7 +175,11 @@ function start_seafile_server () { sleep 2 # seafile-monitor - ${INSTALLPATH}/seafile-monitor.sh &>> ${TOPDIR}/logs/seafile-monitor.log & + if [[ $SEAFILE_LOG_TO_STDOUT = "true" ]]; then + ${INSTALLPATH}/seafile-monitor.sh & + else + ${INSTALLPATH}/seafile-monitor.sh &>> ${TOPDIR}/logs/seafile-monitor.log & + fi sleep 1 diff --git a/scripts/seahub.sh b/scripts/seahub.sh index d9cbfea254..87edbf7c4d 100755 --- a/scripts/seahub.sh +++ b/scripts/seahub.sh @@ -172,7 +172,7 @@ function start_seahub () { check_init_admin; export DJANGO_SETTINGS_MODULE=seahub.settings - $PYTHON $gunicorn_exe seahub.wsgi:application -c "${gunicorn_conf}" --preload + $PYTHON $gunicorn_exe seahub.wsgi:application -c "${gunicorn_conf}" --preload & # Ensure seahub is started successfully sleep 5 diff --git a/seahub/settings.py b/seahub/settings.py index 253f684646..3de2ffa5bb 100644 --- a/seahub/settings.py +++ b/seahub/settings.py @@ -647,12 +647,8 @@ TERMS_OF_SERVICE_LINK = '' ALLOWED_HOSTS = ['*'] # Logging -seafile_log_to_stdout = os.getenv('SEAFILE_LOG_TO_STDOUT', 0) -try: - enable_log_to_stdout = int(seafile_log_to_stdout) -except ValueError: - enable_log_to_stdout = 0 -if enable_log_to_stdout: +seafile_log_to_stdout = os.getenv('SEAFILE_LOG_TO_STDOUT', 'false') == 'true' +if seafile_log_to_stdout: LOGGING = { 'version': 1, # Enable existing loggers so that gunicorn errors will be bubbled up when