Quellcode durchsuchen

异步推送消息和保存数据

locky vor 1 Jahr
Ursprung
Commit
49ba51a72e

+ 3 - 4
AnsjerPush/cn_config/cn_formal_settings.py

@@ -200,7 +200,7 @@ LOGGING = {
         },
         'info': {
             'level': 'INFO',
-            'class': 'logging.handlers.RotatingFileHandler',
+            'class': 'logging.handlers.TimedRotatingFileHandler',
             'filename': BASE_DIR + '/static/log/info/info.log',
             'backupCount': 10,
             'maxBytes': 1024 * 1024 * 2 * 1024,  # 2G
@@ -211,8 +211,8 @@ LOGGING = {
             'level': 'INFO',
             'class': 'logging.handlers.TimedRotatingFileHandler',
             'filename': BASE_DIR + '/static/log/time/info.log',
-            'backupCount': 30,
-            'when': 'D',
+            'backupCount': 10,
+            'maxBytes': 1024 * 1024 * 2 * 1024,  # 2G
             'formatter': 'standard',
             'encoding': 'utf-8',
         },
@@ -220,7 +220,6 @@ LOGGING = {
     'loggers': {
         'django': {
             'handlers': ['default', 'console'],
-            # 'handlers': ['mail_admins','default','console'],
             'level': 'ERROR',
             'propagate': False
         },

+ 5 - 7
AnsjerPush/eur_config/eur_formal_settings.py

@@ -165,7 +165,6 @@ LOGGING = {
     'disable_existing_loggers': True,
     'formatters': {
         'error_format': {
-            # 'format': '{"asctime":"%(asctime)s","thread":"%(threadName)s:%(thread)d","errorline":"%(lineno)d","errorlevel":"%(levelname)s","errorcontent":"%(message)s"}'
             'format': '%(asctime)s %(threadName)s %(thread)d %(lineno)d %(levelname)s %(message)s'
         },
         'standard': {
@@ -195,10 +194,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,
+            'backupCount': 10,
+            'maxBytes': 1024 * 1024 * 2 * 1024,  # 2G
             'formatter': 'standard',
             'encoding': 'utf-8',
         },
@@ -206,8 +205,8 @@ LOGGING = {
             'level': 'INFO',
             'class': 'logging.handlers.TimedRotatingFileHandler',
             'filename': BASE_DIR + '/static/log/time/info.log',
-            'backupCount': 30,
-            'when': 'D',
+            'backupCount': 10,
+            'maxBytes': 1024 * 1024 * 2 * 1024,  # 2G
             'formatter': 'standard',
             'encoding': 'utf-8',
         },
@@ -215,7 +214,6 @@ LOGGING = {
     'loggers': {
         'django': {
             'handlers': ['default', 'console'],
-            # 'handlers': ['mail_admins','default','console'],
             'level': 'ERROR',
             'propagate': False
         },

+ 5 - 5
AnsjerPush/test_config/test_settings.py

@@ -201,8 +201,8 @@ LOGGING = {
             'level': 'INFO',
             'class': 'logging.handlers.TimedRotatingFileHandler',
             'filename': BASE_DIR + '/static/log/info/info.log',
-            'backupCount': 30,
-            'when': 'D',
+            'backupCount': 10,
+            'maxBytes': 1024 * 1024 * 2 * 1024,  # 2G
             'formatter': 'standard',
             'encoding': 'utf-8',
         },
@@ -210,8 +210,8 @@ LOGGING = {
             'level': 'INFO',
             'class': 'logging.handlers.TimedRotatingFileHandler',
             'filename': BASE_DIR + '/static/log/time/info.log',
-            'backupCount': 30,
-            'when': 'D',
+            'backupCount': 10,
+            'maxBytes': 1024 * 1024 * 2 * 1024,  # 2G
             'formatter': 'standard',
             'encoding': 'utf-8',
         },
@@ -220,7 +220,7 @@ LOGGING = {
         'django': {
             'handlers': ['default', 'console'],
             'level': 'ERROR',
-            'propagate': True
+            'propagate': False
         },
         # log 调用时需要当作参数传入
         'info': {

+ 4 - 6
AnsjerPush/us_config/formal_settings.py

@@ -172,7 +172,6 @@ LOGGING = {
     'disable_existing_loggers': True,
     'formatters': {
         'error_format': {
-            # 'format': '{"asctime":"%(asctime)s","thread":"%(threadName)s:%(thread)d","errorline":"%(lineno)d","errorlevel":"%(levelname)s","errorcontent":"%(message)s"}'
             'format': '%(asctime)s %(threadName)s %(thread)d %(lineno)d %(levelname)s %(message)s'
         },
         'standard': {
@@ -202,10 +201,10 @@ LOGGING = {
         },
         'info': {
             'level': 'INFO',
-            'class': 'logging.handlers.RotatingFileHandler',
+            'class': 'logging.handlers.TimedRotatingFileHandler',
             'filename': BASE_DIR + '/static/log/info/info.log',
+            'backupCount': 10,
             'maxBytes': 1024 * 1024 * 2 * 1024,  # 2G
-            'backupCount': 30,
             'formatter': 'standard',
             'encoding': 'utf-8',
         },
@@ -213,8 +212,8 @@ LOGGING = {
             'level': 'INFO',
             'class': 'logging.handlers.TimedRotatingFileHandler',
             'filename': BASE_DIR + '/static/log/time/info.log',
-            'backupCount': 30,
-            'when': 'D',
+            'backupCount': 10,
+            'maxBytes': 1024 * 1024 * 2 * 1024,  # 2G
             'formatter': 'standard',
             'encoding': 'utf-8',
         },
@@ -222,7 +221,6 @@ LOGGING = {
     'loggers': {
         'django': {
             'handlers': ['default', 'console'],
-            # 'handlers': ['mail_admins','default','console'],
             'level': 'ERROR',
             'propagate': False
         },