mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-09 21:38:47 -05:00
[PR #20114] [CLOSED] feat: Add audit logs optionally to stdout #64327
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?
📋 Pull Request Information
Original PR: https://github.com/open-webui/open-webui/pull/20114
Author: @bryanherman
Created: 12/22/2025
Status: ❌ Closed
Base:
dev← Head:add-audit-logs-to-stdout📝 Commits (2)
ea0ce73feat: add audit logging configuration for stdout and file5c7f1dbtest: add unit tests for audit logging configuration with stdout and file📊 Changes
3 files changed (+280 additions, -13 deletions)
View changed files
📝
backend/open_webui/env.py(+6 -0)➕
backend/open_webui/test/utils/test_logger.py(+250 -0)📝
backend/open_webui/utils/logger.py(+24 -13)📄 Description
Pull Request Checklist
Note to first-time contributors: Please open a discussion post in Discussions to discuss your idea/fix with the community before creating a pull request, and describe your changes before submitting a pull request.
Discussion at: https://github.com/open-webui/open-webui/discussions/20112
This is to ensure large feature PRs are discussed with the community first, before starting work on it. If the community does not want this feature or it is not relevant for Open WebUI as a project, it can be identified in the discussion before working on the feature and submitting the PR.
Before submitting, make sure you've checked the following:
devbranch. Not targeting thedevbranch will lead to immediate closure of the PR.Changelog Entry
Description
This pull request introduces configurable audit logging options, allowing audit logs to be selectively enabled for stdout and/or file output using environment variables. It also adds tests to ensure these configurations work as expected.
Added
AUDIT_ENABLE_STDOUTandAUDIT_ENABLE_FILEenvironment variables inenv.pyto control whether audit logs are output to stdout and/or file, with sensible defaults (Falsefor stdout,Truefor file).test_logger.py) that covers all combinations of the new audit logging environment variables, ensuring correct parsing and logger behavior under various configurations.Changed
start_loggerinlogger.pyto use these new variables, allowing fine-grained control over audit log destinations and ensuring audit logs are only output to enabled targets.Deprecated
N/A
Removed
N/A
Fixed
start_loggerinlogger.py.Security
N/A
Breaking Changes
N/A new config variables provide backward compatible behavior.
Additional Information
N/A
Screenshots or Videos
N/A
Contributor License Agreement
By submitting this pull request, I confirm that I have read and fully agree to the Contributor License Agreement (CLA), and I am providing my contributions under its terms.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.