mirror of
https://github.com/open-webui/terminals.git
synced 2026-11-05 01:37:21 +00:00
[PR #13] [MERGED] fix: logging updates to prevent silent errors #48
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
open-webui/terminals#48
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/open-webui/terminals/pull/13
Author: @james-westbrook
Created: 3/29/2026
Status: ✅ Merged
Merged: 3/29/2026
Merged by: @tjbck
Base:
main← Head:logging-fixes📝 Commits (1)
0cb5a73fix: logging updates to prevent silent errors📊 Changes
4 files changed (+10 additions, -5 deletions)
View changed files
📝
Dockerfile(+2 -0)📝
terminals/logging.py(+3 -1)📝
terminals/main.py(+4 -3)📝
terminals/migrations/env.py(+1 -1)📄 Description
Description
Fixes logging silenced after Alembic migrationes
All log messages after startup (including "Idle reaper started", "Application startup complete", and request access logs) were silently dropped in containerized deployments. The idle reaper worked, but was invisible in
kubectl logs, making it impossible to confirm or debug.Root cause
Alembic's
fileConfig()call inmigrations/env.pyreconfigures Python's root logger duringinit_db(), which:_InterceptHandler(loguru bridge) with a plainStreamHandlerat level WARNdisabled=Trueon all pre-existing loggers viadisable_existing_loggers=True(the default)Since
setup_logging()ran beforeinit_db(), our entire logging pipeline was silently destroyed mid-startup.Fix
main.py: Movesetup_logging()to run afterinit_db()so the loguru intercept handler is installed after Alembic is done reconfiguring logging.migrations/env.py: Passdisable_existing_loggers=FalsetofileConfig()so it doesn't disable loggers created during module import.logging.py: Setpropagate=Falseon intercepted named loggers (uvicorn, sqlalchemy) to prevent duplicate log lines from both the named handler and root handler.Dockerfile: AddENV PYTHONUNBUFFERED=1so Python doesn't buffer stderr in containers (standard practice, discovered during investigation).Contributor License Agreement
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.