[PR #8053] [MERGED] enh: add configurable log level for uvicorn server #45198

Closed
opened 2026-04-29 19:32:39 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/open-webui/open-webui/pull/8053
Author: @Adhithya03
Created: 12/25/2024
Status: Merged
Merged: 12/25/2024
Merged by: @tjbck

Base: devHead: main


📝 Commits (2)

  • 16da847 enh: add configurable log level for uvicorn server
  • d52fc40 format

📊 Changes

1 file changed (+3 additions, -1 deletions)

View changed files

📝 backend/open_webui/__init__.py (+3 -1)

📄 Description

Addresses #7859

This pull request introduces an enhancement that allows users to configure the log level of the Uvicorn server through the GLOBAL_LOG_LEVEL environment variable. By making the log level configurable, developers and users can adjust the verbosity of the server logs according to their needs.

Changes Made:

  1. Import GLOBAL_LOG_LEVEL:

    • Added an import statement to bring in the GLOBAL_LOG_LEVEL from open_webui.env.
      + from open_webui.env import GLOBAL_LOG_LEVEL
      
  2. Modify uvicorn.run Parameters:

    • Updated the uvicorn.run function call to include the log_level parameter.
    • Set the log_level parameter to GLOBAL_LOG_LEVEL.lower() to match Uvicorn's expected log level formats (e.g., 'info', 'debug', 'warning', 'error', 'critical').
      - uvicorn.run(open_webui.main.app, host=host, port=port, forwarded_allow_ips="*")
      + uvicorn.run(open_webui.main.app, host=host, port=port, forwarded_allow_ips="*", log_level=GLOBAL_LOG_LEVEL.lower())
      

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/open-webui/open-webui/pull/8053 **Author:** [@Adhithya03](https://github.com/Adhithya03) **Created:** 12/25/2024 **Status:** ✅ Merged **Merged:** 12/25/2024 **Merged by:** [@tjbck](https://github.com/tjbck) **Base:** `dev` ← **Head:** `main` --- ### 📝 Commits (2) - [`16da847`](https://github.com/open-webui/open-webui/commit/16da8473422e6aff89a6af073d90bdf54c6e29e1) enh: add configurable log level for uvicorn server - [`d52fc40`](https://github.com/open-webui/open-webui/commit/d52fc40038ddb8ee6c8c34f33b7c820f7ddf114d) format ### 📊 Changes **1 file changed** (+3 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `backend/open_webui/__init__.py` (+3 -1) </details> ### 📄 Description Addresses #7859 This pull request introduces an enhancement that allows users to configure the log level of the Uvicorn server through the `GLOBAL_LOG_LEVEL` environment variable. By making the log level configurable, developers and users can adjust the verbosity of the server logs according to their needs. **Changes Made:** 1. **Import `GLOBAL_LOG_LEVEL`:** - Added an import statement to bring in the `GLOBAL_LOG_LEVEL` from `open_webui.env`. ```python + from open_webui.env import GLOBAL_LOG_LEVEL ``` 2. **Modify `uvicorn.run` Parameters:** - Updated the `uvicorn.run` function call to include the `log_level` parameter. - Set the `log_level` parameter to `GLOBAL_LOG_LEVEL.lower()` to match Uvicorn's expected log level formats (e.g., 'info', 'debug', 'warning', 'error', 'critical'). ```python - uvicorn.run(open_webui.main.app, host=host, port=port, forwarded_allow_ips="*") + uvicorn.run(open_webui.main.app, host=host, port=port, forwarded_allow_ips="*", log_level=GLOBAL_LOG_LEVEL.lower()) ``` --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-29 19:32:40 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#45198