feat: 从配置中添加运行时清理选项,增强日志监控功能

This commit is contained in:
Your Name committed 2026-01-07 19:06:44 +08:00
1 parent c6b6745e3e
commit 210014d5b1
1 file changed
+11
+11
View File
@@ -749,11 +749,22 @@ def configure_logging(
# 启动日志监控器
if enable_monitor:
try:
# 从配置中读取是否允许运行时清理(默认为 False)
try:
enable_runtime_cleanup_cfg = False
if isinstance(log_config, dict):
enable_runtime_cleanup_cfg = bool(
log_config.get("enable_runtime_cleanup", False)
)
except Exception:
enable_runtime_cleanup_cfg = False
start_log_monitor(
logs_dir=log_dir or path_config.get_logs_dir(),
base_name=os.path.basename(base_filename_base),
warning_size_mb=monitor_warning_mb,
critical_size_mb=monitor_critical_mb,
enable_runtime_cleanup=enable_runtime_cleanup_cfg,
)
except Exception as e:
try: