添加二维码日志

This commit is contained in:
2024-09-02 16:59:25 +08:00
parent e0bfbba17e
commit 0ef0f85e00
5 changed files with 22 additions and 13 deletions

View File

@@ -7,6 +7,7 @@ HOSTNAME = socket.gethostname()
LOG_PATHS = [
f"log/{HOSTNAME}/ucloud",
f"log/{HOSTNAME}/error",
f"log/{HOSTNAME}/qr",
]
for path in LOG_PATHS:
if not os.path.exists(path):
@@ -63,6 +64,16 @@ LOGGING_CONFIG = {
'backupCount': 14,
'encoding': 'utf-8',
},
'qr': {
'class': 'logging.handlers.TimedRotatingFileHandler',
'level': 'INFO',
'formatter': 'standard',
'filename': f'log/{HOSTNAME}/qr/fcb_photo_review_qr.log',
'when': 'midnight',
'interval': 1,
'backupCount': 14,
'encoding': 'utf-8',
},
},
# loggers定义了日志记录器
@@ -81,6 +92,11 @@ LOGGING_CONFIG = {
'handlers': ['console', 'file', 'error'],
'level': 'DEBUG',
'propagate': False,
}
},
'qr': {
'handlers': ['console', 'qr'],
'level': 'DEBUG',
'propagate': False,
},
},
}