删除过期数据

This commit is contained in:
2025-08-12 11:13:14 +08:00
parent ab5f78cc7b
commit 109a5e9444
3 changed files with 81 additions and 1 deletions

View File

@@ -8,6 +8,7 @@ LOG_PATHS = [
f"log/{HOSTNAME}/ucloud",
f"log/{HOSTNAME}/error",
f"log/{HOSTNAME}/qr",
f"log/{HOSTNAME}/sql",
]
for path in LOG_PATHS:
if not os.path.exists(path):
@@ -74,6 +75,16 @@ LOGGING_CONFIG = {
'backupCount': 14,
'encoding': 'utf-8',
},
'sql': {
'class': 'logging.handlers.TimedRotatingFileHandler',
'level': 'INFO',
'formatter': 'standard',
'filename': f'log/{HOSTNAME}/sql/fcb_photo_review_sql.log',
'when': 'midnight',
'interval': 1,
'backupCount': 14,
'encoding': 'utf-8',
},
},
# loggers定义了日志记录器
@@ -98,5 +109,10 @@ LOGGING_CONFIG = {
'level': 'DEBUG',
'propagate': False,
},
'sql': {
'handlers': ['console', 'sql'],
'level': 'DEBUG',
'propagate': False,
},
},
}