mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-07 11:28:35 -05:00
[GH-ISSUE #17943] issue: Debug print() statements in middleware.py pollute logs #18445
Reference in New Issue
Block a user
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?
Originally created by @rbb-dev on GitHub (Oct 1, 2025).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/17943
Check Existing Issues
Installation Method
Docker
Open WebUI Version
v0.6.32
Ollama Version (if applicable)
No response
Operating System
Ubuntu 24.04
Browser (if applicable)
No response
Confirmation
README.md.Expected Behavior
Log output should respect the configured logging levels (e.g., only emit detailed state dumps when debug logging is enabled).
Actual Behavior
Since commit
91b6483, the following hardcoded print() statements in backend/open_webui/utils/middleware.py always execute:This causes excessive and uncontrolled output to stdout, even in production. They bypass the logging configuration and flood logs with internal state that is usually only relevant for debugging.
Steps to Reproduce
Run the server with standard logging configuration (e.g., default info level).
Trigger a request that flows through middleware.py.
Observe that Final form_data, Final metadata, and Final events are printed to stdout regardless of log level.
Logs & Screenshots
As per above, due to the use of print(), logas are growing expotentially
Additional Information
No response
@tjbck commented on GitHub (Oct 1, 2025):
Addressed in dev.
@rbb-dev commented on GitHub (Oct 1, 2025):
Thank you
@pdeubel commented on GitHub (Oct 2, 2025):
There are some more print statements and also logging statements that leak user data, see https://github.com/open-webui/open-webui/discussions/17939
I have fixed the code lines in my fork https://github.com/open-webui/open-webui/compare/main...pdeubel:open-webui:fix-prod-logging
It is currently based on the
mainbranch, if you want I can rebase ondevand open a PR for it 🙂