feat: 添加日志管理和敏感词过滤功能

- 新增日志管理模块:操作日志、登录日志、数据变更日志
- 新增敏感词过滤器 (sanitizer)
- 新增日志异步写入管理器
- 新增日志定时清理服务
- 优化帖子相关服务和上传服务
This commit is contained in:
2026-03-15 02:25:10 +08:00
parent d3065b30cc
commit ebd9cb8b04
31 changed files with 2753 additions and 60 deletions

View File

@@ -87,6 +87,32 @@ log:
output_paths:
- stdout
- ./logs/app.log
retention:
access_log: 180 # HTTP访问日志 6个月
operation_log: 365 # 操作日志 1年
login_log: 1095 # 登录日志 3年
data_change: 1095 # 数据变更日志 3年
async:
buffer_size: 10000
batch_size: 100
flush_interval: 3s
worker_count: 3
enable_fallback: true
fallback_path: ./logs/fallback.log
sensitive:
enabled: true
mask_fields:
- password
- token
- secret
- phone
- id_card
- bank_card
rotation:
max_size: 100
max_age: 30
max_backups: 10
compress: true
rate_limit:
enabled: true