From a439a5681fe204976677bb4af964dfa83c2e76ba Mon Sep 17 00:00:00 2001 From: liangyongxiong Date: Tue, 1 Dec 2020 15:36:56 +0800 Subject: [PATCH] update startup monitor rule for new filename of gunicorn logs --- mindinsight/backend/run.py | 4 ++-- mindinsight/scripts/stop.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/mindinsight/backend/run.py b/mindinsight/backend/run.py index adc74689..80e4d2ce 100644 --- a/mindinsight/backend/run.py +++ b/mindinsight/backend/run.py @@ -118,14 +118,14 @@ def _get_error_log_path(): str, the path of error log. """ - path = os.path.join(settings.WORKSPACE, 'log/gunicorn/error.log') + path = os.path.join(settings.WORKSPACE, 'log/gunicorn/error.{}.log'.format(settings.PORT)) errorlog_abspath = os.path.realpath(path) return errorlog_abspath def _get_access_log_path(): """Get gunicorn access log path.""" - access_log_path = os.path.join(settings.WORKSPACE, 'log/gunicorn/access.log') + access_log_path = os.path.join(settings.WORKSPACE, 'log/gunicorn/access.{}.log'.format(settings.PORT)) access_log_path = os.path.realpath(access_log_path) return access_log_path diff --git a/mindinsight/scripts/stop.py b/mindinsight/scripts/stop.py index ebffe177..2e4ee34e 100644 --- a/mindinsight/scripts/stop.py +++ b/mindinsight/scripts/stop.py @@ -56,7 +56,7 @@ class Command(BaseCommand): description = 'stop mindinsight service' cmd_regex = 'mindinsight.backend.application:APP' - access_log_path = os.path.join('gunicorn', 'access.log') + access_log_path = os.path.join('gunicorn', 'access.{}.log'.format(settings.PORT)) def add_arguments(self, parser): """