Bladeren bron

修改日志文件大小上线

linhaohong 7 maanden geleden
bovenliggende
commit
1501eb2b4a
1 gewijzigde bestanden met toevoegingen van 7 en 6 verwijderingen
  1. 7 6
      AnsjerPush/cn_config/cn_formal_settings.py

+ 7 - 6
AnsjerPush/cn_config/cn_formal_settings.py

@@ -198,12 +198,13 @@ LOGGING = {
             'class': 'logging.StreamHandler',
             'formatter': 'error_format'
         },
+        # 总计info、time、v1_push日志给57GB空间
         'info': {
             'level': 'INFO',
             'class': 'concurrent_log_handler.ConcurrentRotatingFileHandler',
             'filename': BASE_DIR + '/static/log/info/info.log',
-            'backupCount': 3,
-            'maxBytes': 1024 * 1024 * 10 * 1024,  # 10G
+            'backupCount': 4,
+            'maxBytes': 1024 * 1024 * 2 * 1024,  # 一天以内2GB 保存5天共10GB
             'formatter': 'standard',
             'encoding': 'utf-8',
             'use_gzip': True,  # 启用 Gzip 压缩
@@ -212,8 +213,8 @@ LOGGING = {
             'level': 'INFO',
             'class': 'concurrent_log_handler.ConcurrentRotatingFileHandler',
             'filename': BASE_DIR + '/static/log/time/info.log',
-            'backupCount': 3,
-            'maxBytes': 1024 * 1024 * 10 * 1024,  # 10G
+            'backupCount': 8,
+            'maxBytes': 1024 * 1024 * 5 * 1024,  # 一天9GB 保存5天 共45GB
             'formatter': 'standard',
             'encoding': 'utf-8',
             'use_gzip': True,  # 启用 Gzip 压缩
@@ -222,8 +223,8 @@ LOGGING = {
             'level': 'INFO',
             'class': 'concurrent_log_handler.ConcurrentRotatingFileHandler',
             'filename': BASE_DIR + '/static/log/v1log/info.log',
-            'backupCount': 3,
-            'maxBytes': 1024 * 1024 * 10 * 1024,  # 10G
+            'backupCount': 1,
+            'maxBytes': 1024 * 1024 * 1 * 1024,  # 一天0.05GB 保存40天 共2GB
             'formatter': 'standard',
             'encoding': 'utf-8',
             'use_gzip': True,  # 启用 Gzip 压缩