mirror of
https://github.com/AJaySi/ALwrity.git
synced 2026-04-25 00:45:54 +03:00
[PR #425] Unify backend logging, add context keys, and capture uncaught exceptions #730
Labels
No labels
AI Content Agents
AI Content Strategy
AI Content planning
AI Marketing Tools
AI SEO
AI personalization
AI writer
ALwrity Copi-lot
Alwrity web search
Anthropic
DeepSeek
Gemini AI
Integration
LLM
OnBoarding
OnBoarding
RAG knowledgebase Memory
bug
documentation
enhancement
good first issue
help wanted
invalid
openai
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/ALwrity#730
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/AJaySi/ALwrity/pull/425
Author: @AJaySi
Created: 3/12/2026
Status: 🔄 Open
Base:
main← Head:codex/enhance-logging-configuration-and-startup-flow📝 Commits (1)
e77bde4Unify backend logging and capture uncaught exceptions📊 Changes
2 files changed (+124 additions, -14 deletions)
View changed files
📝
backend/logging_config.py(+122 -13)📝
backend/start_alwrity_backend.py(+2 -1)📄 Description
Motivation
Description
sys.excepthookand an asyncio loop exception handler to surface unhandled exceptions with tracebacks via Loguru inbackend/logging_config.py.request_id,job_id,user_id) vialogger.configure(patcher=...)and included them in a sharedcommon_formatsologger.bind(...)context appears consistently.InterceptHandlerthat routes standardloggingrecords into Loguru and wireduvicorn,uvicorn.error, anduvicorn.accessto use this handler so they share the same sinks/format in both verbose and non-verbose modes.{exception}in the format so ERROR/CRITICAL logs that include exceptions still print full tracebacks.uvicorn.run(..., log_config=None)inbackend/start_alwrity_backend.pyso Uvicorn does not override the unified logging configuration.Testing
python -m compileall backend/logging_config.py backend/start_alwrity_backend.pyto validate syntax and byte-compile both modified modules, which completed successfully.backend/logging_config.pyandbackend/start_alwrity_backend.pyand that the startup invocation includeslog_config=None(no runtime tests were run as part of this change).Codex Task
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.