locky 1 жил өмнө
parent
commit
146650a4d6

+ 9 - 9
Ansjer/cn_config/formal_settings.py

@@ -221,10 +221,10 @@ LOGGING = {
         },
         'default': {
             'level': 'ERROR',
-            'class': 'logging.handlers.TimedRotatingFileHandler',
+            'class': 'logging.handlers.RotatingFileHandler',
             'filename': BASE_DIR + '/static/log/error/error.log',
-            'backupCount': 30,
-            'when': 'D',
+            'maxBytes': 1024 * 1024 * 5,  # 5 MB
+            'backupCount': 5,
             'formatter': 'error_format',
         },
         'console': {
@@ -234,19 +234,19 @@ LOGGING = {
         },
         'info': {
             'level': 'INFO',
-            'class': 'logging.handlers.TimedRotatingFileHandler',
+            'class': 'logging.handlers.RotatingFileHandler',
             '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',
         },
         'error_code': {
             'level': 'INFO',
-            'class': 'logging.handlers.TimedRotatingFileHandler',
+            'class': 'logging.handlers.RotatingFileHandler',
             'filename': BASE_DIR + '/static/log/error_code/error_code.log',
-            'backupCount': 30,
-            'when': 'D',
+            'backupCount': 10,
+            'maxBytes': 1024 * 1024 * 2 * 1024,  # 2G
             'formatter': 'standard',
             'encoding': 'utf-8',
         },

+ 9 - 9
Ansjer/cn_config/test_settings.py

@@ -222,10 +222,10 @@ LOGGING = {
         },
         'default': {
             'level': 'ERROR',
-            'class': 'logging.handlers.TimedRotatingFileHandler',
+            'class': 'logging.handlers.RotatingFileHandler',
             'filename': BASE_DIR + '/static/log/error/error.log',
-            'backupCount': 30,
-            'when': 'D',
+            'maxBytes': 1024 * 1024 * 5,  # 5 MB
+            'backupCount': 5,
             'formatter': 'error_format',
         },
         'console': {
@@ -235,19 +235,19 @@ LOGGING = {
         },
         'info': {
             'level': 'INFO',
-            'class': 'logging.handlers.TimedRotatingFileHandler',
+            'class': 'logging.handlers.RotatingFileHandler',
             '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',
         },
         'error_code': {
             'level': 'INFO',
-            'class': 'logging.handlers.TimedRotatingFileHandler',
+            'class': 'logging.handlers.RotatingFileHandler',
             'filename': BASE_DIR + '/static/log/error_code/error_code.log',
-            'backupCount': 30,
-            'when': 'D',
+            'backupCount': 10,
+            'maxBytes': 1024 * 1024 * 2 * 1024,  # 2G
             'formatter': 'standard',
             'encoding': 'utf-8',
         },

+ 9 - 9
Ansjer/eur_config/formal_settings.py

@@ -218,10 +218,10 @@ LOGGING = {
         },
         'default': {
             'level': 'ERROR',
-            'class': 'logging.handlers.TimedRotatingFileHandler',
+            'class': 'logging.handlers.RotatingFileHandler',
             'filename': BASE_DIR + '/static/log/error/error.log',
-            'backupCount': 30,
-            'when': 'D',
+            'maxBytes': 1024 * 1024 * 5,  # 5 MB
+            'backupCount': 5,
             'formatter': 'error_format',
         },
         'console': {
@@ -231,19 +231,19 @@ LOGGING = {
         },
         'info': {
             'level': 'INFO',
-            'class': 'logging.handlers.TimedRotatingFileHandler',
+            'class': 'logging.handlers.RotatingFileHandler',
             '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',
         },
         'error_code': {
             'level': 'INFO',
-            'class': 'logging.handlers.TimedRotatingFileHandler',
+            'class': 'logging.handlers.RotatingFileHandler',
             'filename': BASE_DIR + '/static/log/error_code/error_code.log',
-            'backupCount': 30,
-            'when': 'D',
+            'backupCount': 10,
+            'maxBytes': 1024 * 1024 * 2 * 1024,  # 2G
             'formatter': 'standard',
             'encoding': 'utf-8',
         },

+ 9 - 9
Ansjer/us_config/formal_settings.py

@@ -221,10 +221,10 @@ LOGGING = {
         },
         'default': {
             'level': 'ERROR',
-            'class': 'logging.handlers.TimedRotatingFileHandler',
+            'class': 'logging.handlers.RotatingFileHandler',
             'filename': BASE_DIR + '/static/log/error/error.log',
-            'backupCount': 30,
-            'when': 'D',
+            'maxBytes': 1024 * 1024 * 5,  # 5 MB
+            'backupCount': 5,
             'formatter': 'error_format',
         },
         'console': {
@@ -234,19 +234,19 @@ LOGGING = {
         },
         'info': {
             'level': 'INFO',
-            'class': 'logging.handlers.TimedRotatingFileHandler',
+            'class': 'logging.handlers.RotatingFileHandler',
             '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',
         },
         'error_code': {
             'level': 'INFO',
-            'class': 'logging.handlers.TimedRotatingFileHandler',
+            'class': 'logging.handlers.RotatingFileHandler',
             'filename': BASE_DIR + '/static/log/error_code/error_code.log',
-            'backupCount': 30,
-            'when': 'D',
+            'backupCount': 10,
+            'maxBytes': 1024 * 1024 * 2 * 1024,  # 2G
             'formatter': 'standard',
             'encoding': 'utf-8',
         },