fix: improve log reliability and correlation

This commit is contained in:
chengyongru authored and chengyongru committed 2026-09-21 17:36:24 +08:00
1 parent 8eea1cb7a4
commit 8a7ca8a654
21 files changed
+698 -91

No files matched your search

+1 -1
View File
@@ -1750,7 +1750,7 @@ class SessionManager:
self.save(session, fsync=True)
flushed += 1
except Exception:
logger.warning("Failed to flush session {}", key, exc_info=True)
logger.opt(exception=True).warning("Failed to flush session {}", key)
return flushed
def invalidate(self, key: str) -> None:
+4 -3
View File
@@ -275,7 +275,9 @@ async def maybe_generate_webui_title(
retry_mode="standard",
)
except Exception:
logger.debug("Failed to generate webui session title for {}", session_key, exc_info=True)
logger.opt(exception=True).debug(
"Failed to generate webui session title for {}", session_key
)
return False
title = clean_generated_title(response.content)
@@ -650,10 +652,9 @@ class WebuiTurnCoordinator:
session_message=public_metadata,
)
except (OSError, TypeError, ValueError):
logger.warning(
logger.opt(exception=True).warning(
"Failed to persist session input {}",
envelope["message_id"],
exc_info=True,
)
await self.bus.publish_outbound(outbound_message_for_event(
channel="websocket",