收款日志固定写入 logs/wechat_collect.log,便于 grep 排查。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
XingQue
2026-07-14 22:29:35 +08:00
parent 43ec4fd749
commit 0271eca248
2 changed files with 20 additions and 1 deletions

View File

@@ -568,7 +568,11 @@ BATCH_LINK_DEFAULT_COUNT = 1
BATCH_LINK_MAX_COUNT = 100
# ==================== 日志配置(终端输出,便于生产排查) ====================
# ==================== 日志配置 ====================
# 收款排障固定文件django/logs/wechat_collect.log搜「微信官方收款」
LOG_DIR = BASE_DIR / 'logs'
os.makedirs(LOG_DIR, exist_ok=True)
LOGGING = {
'version': 1,
'disable_existing_loggers': False,
@@ -588,6 +592,15 @@ LOGGING = {
'formatter': 'verbose',
'level': 'INFO',
},
'wechat_collect_file': {
'class': 'logging.handlers.RotatingFileHandler',
'filename': str(LOG_DIR / 'wechat_collect.log'),
'maxBytes': 20 * 1024 * 1024,
'backupCount': 5,
'formatter': 'verbose',
'level': 'INFO',
'encoding': 'utf-8',
},
},
'root': {
'handlers': ['console'],
@@ -609,6 +622,12 @@ LOGGING = {
'level': 'INFO',
'propagate': False,
},
# 自动提现收款:固定写到 logs/wechat_collect.log便于 grep
'yonghu.tixian_shenhe': {
'handlers': ['console', 'wechat_collect_file'],
'level': 'INFO',
'propagate': False,
},
'dingdan': {
'handlers': ['console'],
'level': 'INFO',

0
logs/.gitkeep Normal file
View File