Procházet zdrojové kódy

美洲推送修改日志配置文件

zhangdongming před 7 měsíci
rodič
revize
d6fcae412c
2 změnil soubory, kde provedl 11 přidání a 14 odebrání
  1. 8 13
      AnsjerPush/us_config/formal_settings.py
  2. 3 1
      Service/PushService.py

+ 8 - 13
AnsjerPush/us_config/formal_settings.py

@@ -204,30 +204,27 @@ LOGGING = {
             'class': 'concurrent_log_handler.ConcurrentRotatingFileHandler',
             'filename': BASE_DIR + '/static/log/info/info.log',
             'backupCount': 3,
-            'maxBytes': 1024 * 1024 * 10 * 1024,  # 10G
+            'maxBytes': 1024 * 1024 * 3 * 1024,  # 3G
             'formatter': 'standard',
-            'encoding': 'utf-8',
-            'use_gzip': True,  # 启用 Gzip 压缩
+            'encoding': 'utf-8'
         },
         'time': {
             'level': 'INFO',
             'class': 'concurrent_log_handler.ConcurrentRotatingFileHandler',
             'filename': BASE_DIR + '/static/log/time/info.log',
             'backupCount': 3,
-            'maxBytes': 1024 * 1024 * 10 * 1024,  # 10G
+            'maxBytes': 1024 * 1024 * 7 * 1024,  # 7G
             'formatter': 'standard',
-            'encoding': 'utf-8',
-            'use_gzip': True,  # 启用 Gzip 压缩
+            'encoding': 'utf-8'
         },
         'v1_push': {
             'level': 'INFO',
             'class': 'concurrent_log_handler.ConcurrentRotatingFileHandler',
             'filename': BASE_DIR + '/static/log/v1log/info.log',
             'backupCount': 3,
-            'maxBytes': 1024 * 1024 * 10 * 1024,  # 10G
+            'maxBytes': 1024 * 1024 * 8 * 1024,  # 8G
             'formatter': 'standard',
-            'encoding': 'utf-8',
-            'use_gzip': True,  # 启用 Gzip 压缩
+            'encoding': 'utf-8'
         },
         'customized_push': {
             'level': 'INFO',
@@ -236,8 +233,7 @@ LOGGING = {
             'backupCount': 3,
             'maxBytes': 1024 * 1024 * 2 * 100,  # 100M
             'formatter': 'standard',
-            'encoding': 'utf-8',
-            'use_gzip': True,  # 启用 Gzip 压缩
+            'encoding': 'utf-8'
         },
         'error_info': {
             'level': 'INFO',
@@ -246,8 +242,7 @@ LOGGING = {
             'backupCount': 3,
             'maxBytes': 1024 * 1024 * 2 * 100,  # 100M
             'formatter': 'standard',
-            'encoding': 'utf-8',
-            'use_gzip': True,  # 启用 Gzip 压缩
+            'encoding': 'utf-8'
         },
     },
     'loggers': {

+ 3 - 1
Service/PushService.py

@@ -27,6 +27,7 @@ from Service.CommonService import CommonService
 from Service.VivoPushService.push_admin.APIMessage import PushMessage
 from Service.VivoPushService.push_admin.APISender import APISender
 from AnsjerPush.config import LOGGER
+TIME_LOGGER = logging.getLogger('time')
 
 
 class PushObject:
@@ -187,9 +188,10 @@ class PushObject:
                                                                          'default_light_settings': True,
                                                                          },
                                                            )
+            TIME_LOGGER.info('uid:{}fcm推送结果:{}'.format(uid, result))
             return True
         except Exception as e:
-            LOGGER.info('uid:{},evnet_type:{},time:{},fcm推送异常:{}'.format(uid, event_type, n_time, repr(e)))
+            TIME_LOGGER.error('uid:{}fcm推送异常:{}'.format(uid, repr(e)))
             return False
 
     @staticmethod