From 878183dbce475e2b4ee47b15c225a11367a50ee5 Mon Sep 17 00:00:00 2001 From: MMXX Date: Thu, 6 Jan 2022 10:16:10 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=97=A5=E5=BF=97=E5=AD=98?= =?UTF-8?q?=E5=82=A8=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../management/commands/services/services/base.py | 2 +- fir_ser/api/management/commands/services/utils.py | 2 +- fir_ser/fir_ser/settings.py | 12 ++++++------ 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/fir_ser/api/management/commands/services/services/base.py b/fir_ser/api/management/commands/services/services/base.py index de06a02..29b1d38 100644 --- a/fir_ser/api/management/commands/services/services/base.py +++ b/fir_ser/api/management/commands/services/services/base.py @@ -30,7 +30,7 @@ class BaseService(object): self.STOP_TIMEOUT = 10 self.max_retry = 0 self.retry = 3 - self.LOG_KEEP_DAYS = 7 + self.LOG_KEEP_DAYS = 30 self.EXIT_EVENT = threading.Event() @property diff --git a/fir_ser/api/management/commands/services/utils.py b/fir_ser/api/management/commands/services/utils.py index 866bddf..5d774e6 100644 --- a/fir_ser/api/management/commands/services/utils.py +++ b/fir_ser/api/management/commands/services/utils.py @@ -125,7 +125,7 @@ class ServicesUtil(object): @property def daemon_log_filepath(self): - return os.path.join(LOG_DIR, 'flyApps.log') + return os.path.join(LOG_DIR, 'flyapps.log') @property def daemon_context(self): diff --git a/fir_ser/fir_ser/settings.py b/fir_ser/fir_ser/settings.py index afe4072..6e0448a 100644 --- a/fir_ser/fir_ser/settings.py +++ b/fir_ser/fir_ser/settings.py @@ -300,7 +300,7 @@ SESSION_CACHE_ALIAS = "default" CAPTCHA_TIMEOUT = 5 # Minutes CAPTCHA_LENGTH = 6 # Chars -BASE_LOG_DIR = os.path.join(BASE_DIR, "logs", "flyapp") +BASE_LOG_DIR = os.path.join(BASE_DIR, "logs", "api") if not os.path.isdir(BASE_LOG_DIR): os.makedirs(BASE_LOG_DIR) LOGGING = { @@ -331,7 +331,7 @@ LOGGING = { 'level': 'INFO', 'class': 'logging.handlers.RotatingFileHandler', # 保存到文件,根据时间自动切 'filename': os.path.join(BASE_LOG_DIR, "flyapp_info.log"), # 日志文件 - 'maxBytes': 1024 * 1024 * 5, # 日志大小 50M + 'maxBytes': 1024 * 1024 * 50, # 日志大小 50M 'backupCount': 10, # 备份数为3 xx.log --> xx.log.2018-08-23_00-00-00 --> xx.log.2018-08-24_00-00-00 --> ... # 'when': 'W6', # 每天一切, 可选值有S/秒 M/分 H/小时 D/天 W0-W6/周(0=周一) midnight/如果没指定时间就默认在午夜 'formatter': 'standard', @@ -341,7 +341,7 @@ LOGGING = { 'level': 'ERROR', 'class': 'logging.handlers.RotatingFileHandler', # 保存到文件,自动切 'filename': os.path.join(BASE_LOG_DIR, "flyapp_err.log"), # 日志文件 - 'maxBytes': 1024 * 1024 * 5, # 日志大小 50M + 'maxBytes': 1024 * 1024 * 50, # 日志大小 50M 'backupCount': 10, 'formatter': 'standard', 'encoding': 'utf-8', @@ -350,7 +350,7 @@ LOGGING = { 'level': 'WARNING', 'class': 'logging.handlers.RotatingFileHandler', # 保存到文件,自动切 'filename': os.path.join(BASE_LOG_DIR, "flyapp_warning.log"), # 日志文件 - 'maxBytes': 1024 * 1024 * 5, # 日志大小 50M + 'maxBytes': 1024 * 1024 * 50, # 日志大小 50M 'backupCount': 10, 'formatter': 'standard', 'encoding': 'utf-8', @@ -359,7 +359,7 @@ LOGGING = { 'level': 'DEBUG', 'class': 'logging.handlers.RotatingFileHandler', # 保存到文件,自动切 'filename': os.path.join(BASE_LOG_DIR, "flyapp_pay.log"), # 日志文件 - 'maxBytes': 1024 * 1024 * 5, # 日志大小 50M + 'maxBytes': 1024 * 1024 * 50, # 日志大小 50M 'backupCount': 10, 'formatter': 'standard', 'encoding': 'utf-8', @@ -368,7 +368,7 @@ LOGGING = { 'level': 'DEBUG', 'class': 'logging.handlers.RotatingFileHandler', # 保存到文件,自动切 'filename': os.path.join(BASE_LOG_DIR, "flyapp_sql.log"), # 日志文件 - 'maxBytes': 1024 * 1024 * 5, # 日志大小 50M + 'maxBytes': 1024 * 1024 * 50, # 日志大小 50M 'backupCount': 10, 'formatter': 'standard', 'encoding': 'utf-8',