Explorar o código

配置日志文件为保存30天

zhangdongming %!s(int64=2) %!d(string=hai) anos
pai
achega
ee12b5dd5d
Modificáronse 1 ficheiros con 2 adicións e 2 borrados
  1. 2 2
      AnsjerPush/cn_config/cn_formal_settings.py

+ 2 - 2
AnsjerPush/cn_config/cn_formal_settings.py

@@ -193,10 +193,10 @@ LOGGING = {
         },
         'info': {
             'level': 'INFO',
-            'class': 'logging.handlers.RotatingFileHandler',
+            'class': 'logging.handlers.TimedRotatingFileHandler',
             'filename': BASE_DIR + '/static/log/info/info.log',
-            'maxBytes': 1024 * 1024 * 300,  # 300M
             'backupCount': 30,
+            'when': 'D',
             'formatter': 'standard',
             'encoding': 'utf-8',
         },