Explorar o código

修改日志配置

locky hai 7 meses
pai
achega
aca128fa81
Modificáronse 1 ficheiros con 15 adicións e 8 borrados
  1. 15 8
      AnsjerPush/eur_config/eur_formal_settings.py

+ 15 - 8
AnsjerPush/eur_config/eur_formal_settings.py

@@ -181,10 +181,10 @@ LOGGING = {
         },
         'default': {
             'level': 'ERROR',
-            'class': 'logging.handlers.RotatingFileHandler',
+            'class': 'concurrent_log_handler.ConcurrentRotatingFileHandler',
             'filename': BASE_DIR + '/static/log/error/error.log',
             'maxBytes': 1024 * 1024 * 5,  # 5 MB
-            'backupCount': 5,
+            'backupCount': 3,
             'formatter': 'error_format',
         },
         'console': {
@@ -194,19 +194,23 @@ LOGGING = {
         },
         'info': {
             'level': 'INFO',
-            'class': 'logging.handlers.RotatingFileHandler',
+            'class': 'concurrent_log_handler.ConcurrentRotatingFileHandler',
             'filename': BASE_DIR + '/static/log/info/info.log',
+            'backupCount': 3,
             'maxBytes': 1024 * 1024 * 10 * 1024,  # 10G
             'formatter': 'standard',
             'encoding': 'utf-8',
+            'use_gzip': True,  # 启用 Gzip 压缩
         },
         'time': {
             'level': 'INFO',
-            'class': 'logging.handlers.RotatingFileHandler',
+            'class': 'concurrent_log_handler.ConcurrentRotatingFileHandler',
             'filename': BASE_DIR + '/static/log/time/info.log',
+            'backupCount': 3,
             'maxBytes': 1024 * 1024 * 10 * 1024,  # 10G
             'formatter': 'standard',
             'encoding': 'utf-8',
+            'use_gzip': True,  # 启用 Gzip 压缩
         },
         'v1_push': {
             'level': 'INFO',
@@ -216,24 +220,27 @@ LOGGING = {
             'maxBytes': 1024 * 1024 * 10 * 1024,  # 10G
             'formatter': 'standard',
             'encoding': 'utf-8',
+            'use_gzip': True,  # 启用 Gzip 压缩
         },
         'customized_push': {
             'level': 'INFO',
-            'class': 'logging.handlers.RotatingFileHandler',
+            'class': 'concurrent_log_handler.ConcurrentRotatingFileHandler',
             'filename': BASE_DIR + '/static/log/customized_push/info.log',
-            'backupCount': 10,
+            'backupCount': 3,
             'maxBytes': 1024 * 1024 * 2 * 100,  # 100M
             'formatter': 'standard',
             'encoding': 'utf-8',
+            'use_gzip': True,  # 启用 Gzip 压缩
         },
         'error_info': {
             'level': 'INFO',
-            'class': 'logging.handlers.RotatingFileHandler',
+            'class': 'concurrent_log_handler.ConcurrentRotatingFileHandler',
             'filename': BASE_DIR + '/static/log/error_info/info.log',
-            'backupCount': 10,
+            'backupCount': 3,
             'maxBytes': 1024 * 1024 * 2 * 100,  # 100M
             'formatter': 'standard',
             'encoding': 'utf-8',
+            'use_gzip': True,  # 启用 Gzip 压缩
         },
     },
     'loggers': {