lang 4 жил өмнө
parent
commit
b52ac03971
1 өөрчлөгдсөн 10 нэмэгдсэн , 21 устгасан
  1. 10 21
      Ansjer/formal_settings.py

+ 10 - 21
Ansjer/formal_settings.py

@@ -107,7 +107,7 @@ DATABASES = {
 }
 DATABASE_ROUTERS = ['Ansjer.database_router.DatabaseAppsRouter']
 DATABASE_APPS_MAPPING = {
-    'Model': 'default',
+    'db1': 'default',
     'db2': 'mysql02',
 }
 
@@ -196,12 +196,6 @@ LOGGING = {
             # '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': {
-            'format': '[%(asctime)s] [%(filename)s:%(lineno)d] [%(module)s:%(funcName)s] '
-                      '[%(levelname)s]- %(message)s'},
-        'simple': {  # 简单格式
-            'format': '%(levelname)s %(message)s'
-        },
     },
     'filters': {
     },
@@ -224,15 +218,15 @@ LOGGING = {
             'class': 'logging.StreamHandler',
             'formatter': 'error_format'
         },
-        'info': {
-            'level': 'INFO',
-            'class': 'logging.handlers.RotatingFileHandler',
-            'filename': BASE_DIR + '/static/log/info.log',
-            'maxBytes': 1024 * 1024 * 5,
-            'backupCount': 5,
-            'formatter': 'standard',
-            'encoding': 'utf-8',  # 设置默认编码
-        },
+        # 'info': {  # 向文件中输出日志
+        #     'level': 'INFO',
+        #     'class': 'logging.handlers.RotatingFileHandler',
+        #     'filename': BASE_DIR + '/static/log/print.log',  # 日志文件的位置
+        #     'maxBytes': 20 * 1024 * 1024,  # 20M大小
+        #     'backupCount': 10,
+        #     'formatter': 'verbose',
+        #     'encoding': 'utf-8'
+        # },
     },
     'loggers': {
         'django': {
@@ -241,10 +235,5 @@ LOGGING = {
             'level': 'ERROR',
             'propagate': False
         },
-        'log': {
-            'handlers': ['info', 'console', 'default'],
-            'level': 'INFO',
-            'propagate': True
-        },
     }
 }