瀏覽代碼

修改国内美洲服日志配置

locky 7 月之前
父節點
當前提交
4e6b2fc6c4
共有 2 個文件被更改,包括 46 次插入37 次删除
  1. 26 17
      Ansjer/cn_config/formal_settings.py
  2. 20 20
      Ansjer/us_config/formal_settings.py

+ 26 - 17
Ansjer/cn_config/formal_settings.py

@@ -223,10 +223,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,
+            'maxBytes': 1024 * 1024 * 2 * 100,  # 200M
             'formatter': 'error_format',
         },
         'console': {
@@ -236,46 +236,55 @@ LOGGING = {
         },
         'info': {
             'level': 'INFO',
-            'class': 'logging.handlers.RotatingFileHandler',
+            'class': 'concurrent_log_handler.ConcurrentRotatingFileHandler',
             'filename': BASE_DIR + '/static/log/info/info.log',
             'backupCount': 5,
-            'maxBytes': 1024 * 1024 * 5 * 1024,  # 5G
+            'maxBytes': 1024 * 1024 * 10 * 1024,  # 10G
             'formatter': 'standard',
             'encoding': 'utf-8',
         },
         'error_code': {
             'level': 'INFO',
-            'class': 'logging.handlers.RotatingFileHandler',
+            'class': 'concurrent_log_handler.ConcurrentRotatingFileHandler',
             'filename': BASE_DIR + '/static/log/error_code/error_code.log',
-            'backupCount': 3,
-            'maxBytes': 1024 * 1024 * 20 * 1024,  # 20G
+            'backupCount': 5,
+            'maxBytes': 1024 * 1024 * 10 * 1024,  # 10G
             'formatter': 'standard',
             'encoding': 'utf-8',
         },
         'success_code': {
             'level': 'INFO',
-            'class': 'logging.handlers.RotatingFileHandler',
+            'class': 'concurrent_log_handler.ConcurrentRotatingFileHandler',
             'filename': BASE_DIR + '/static/log/success_code/success_code.log',
-            'backupCount': 3,
-            'maxBytes': 1024 * 1024 * 20 * 1024,  # 20G
+            'backupCount': 5,
+            'maxBytes': 1024 * 1024 * 10 * 1024,  # 10G
             'formatter': 'standard',
             'encoding': 'utf-8',
         },
         'pay': {
             'level': 'INFO',
-            'class': 'logging.handlers.TimedRotatingFileHandler',
+            'class': 'concurrent_log_handler.ConcurrentRotatingFileHandler',
             'filename': BASE_DIR + '/static/log/pay/info.log',
-            'backupCount': 60,
-            'when': 'D',
+            'backupCount': 3,
+            'maxBytes': 1024 * 1024 * 2 * 100,  # 200M
+            'formatter': 'standard',
+            'encoding': 'utf-8',
+        },
+        'apple_pay': {
+            'level': 'INFO',
+            'class': 'concurrent_log_handler.ConcurrentRotatingFileHandler',
+            'filename': BASE_DIR + '/static/log/apple_pay/apple_pay.log',
+            'backupCount': 3,
+            'maxBytes': 1024 * 1024 * 2 * 100,  # 200M
             'formatter': 'standard',
             'encoding': 'utf-8',
         },
         'token': {
             'level': 'INFO',
-            'class': 'logging.handlers.TimedRotatingFileHandler',
+            'class': 'concurrent_log_handler.ConcurrentRotatingFileHandler',
             'filename': BASE_DIR + '/static/log/token/token.log',
-            'backupCount': 60,
-            'when': 'D',
+            'backupCount': 3,
+            'maxBytes': 1024 * 1024 * 2 * 1024,  # 2G
             'formatter': 'standard',
             'encoding': 'utf-8',
         },

+ 20 - 20
Ansjer/us_config/formal_settings.py

@@ -223,10 +223,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,
+            'maxBytes': 1024 * 1024 * 2 * 100,  # 200M
             'formatter': 'error_format',
         },
         'console': {
@@ -236,55 +236,55 @@ LOGGING = {
         },
         'info': {
             'level': 'INFO',
-            'class': 'logging.handlers.RotatingFileHandler',
+            'class': 'concurrent_log_handler.ConcurrentRotatingFileHandler',
             'filename': BASE_DIR + '/static/log/info/info.log',
             'backupCount': 5,
-            'maxBytes': 1024 * 1024 * 5 * 1024,  # 5G
+            'maxBytes': 1024 * 1024 * 10 * 1024,  # 10G
             'formatter': 'standard',
             'encoding': 'utf-8',
         },
         'error_code': {
             'level': 'INFO',
-            'class': 'logging.handlers.RotatingFileHandler',
+            'class': 'concurrent_log_handler.ConcurrentRotatingFileHandler',
             'filename': BASE_DIR + '/static/log/error_code/error_code.log',
-            'backupCount': 3,
-            'maxBytes': 1024 * 1024 * 20 * 1024,  # 20G
+            'backupCount': 5,
+            'maxBytes': 1024 * 1024 * 10 * 1024,  # 10G
             'formatter': 'standard',
             'encoding': 'utf-8',
         },
         'success_code': {
             'level': 'INFO',
-            'class': 'logging.handlers.RotatingFileHandler',
+            'class': 'concurrent_log_handler.ConcurrentRotatingFileHandler',
             'filename': BASE_DIR + '/static/log/success_code/success_code.log',
-            'backupCount': 3,
-            'maxBytes': 1024 * 1024 * 20 * 1024,  # 20G
+            'backupCount': 5,
+            'maxBytes': 1024 * 1024 * 10 * 1024,  # 10G
             'formatter': 'standard',
             'encoding': 'utf-8',
         },
         'pay': {
             'level': 'INFO',
-            'class': 'logging.handlers.TimedRotatingFileHandler',
+            'class': 'concurrent_log_handler.ConcurrentRotatingFileHandler',
             'filename': BASE_DIR + '/static/log/pay/info.log',
-            'backupCount': 60,
-            'when': 'D',
+            'backupCount': 3,
+            'maxBytes': 1024 * 1024 * 2 * 100,  # 200M
             'formatter': 'standard',
             'encoding': 'utf-8',
         },
         'apple_pay': {
             'level': 'INFO',
-            'class': 'logging.handlers.RotatingFileHandler',
+            'class': 'concurrent_log_handler.ConcurrentRotatingFileHandler',
             'filename': BASE_DIR + '/static/log/apple_pay/apple_pay.log',
-            'backupCount': 10,
-            'maxBytes': 1024 * 1024 * 2 * 1024,  # 2G
+            'backupCount': 3,
+            'maxBytes': 1024 * 1024 * 2 * 100,  # 200M
             'formatter': 'standard',
             'encoding': 'utf-8',
         },
         'token': {
             'level': 'INFO',
-            'class': 'logging.handlers.TimedRotatingFileHandler',
+            'class': 'concurrent_log_handler.ConcurrentRotatingFileHandler',
             'filename': BASE_DIR + '/static/log/token/token.log',
-            'backupCount': 60,
-            'when': 'D',
+            'backupCount': 3,
+            'maxBytes': 1024 * 1024 * 2 * 1024,  # 2G
             'formatter': 'standard',
             'encoding': 'utf-8',
         },