From 16da8473422e6aff89a6af073d90bdf54c6e29e1 Mon Sep 17 00:00:00 2001 From: Adhithya03 Date: Tue, 24 Dec 2024 22:18:31 +0530 Subject: [PATCH 1/2] enh: add configurable log level for uvicorn server --- backend/open_webui/__init__.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/backend/open_webui/__init__.py b/backend/open_webui/__init__.py index de34a8bc7..1376859ad 100644 --- a/backend/open_webui/__init__.py +++ b/backend/open_webui/__init__.py @@ -6,11 +6,15 @@ from pathlib import Path import typer import uvicorn +from open_webui.env import (GLOBAL_LOG_LEVEL) + app = typer.Typer() KEY_FILE = Path.cwd() / ".webui_secret_key" + + @app.command() def serve( host: str = "0.0.0.0", @@ -55,7 +59,7 @@ def serve( import open_webui.main # we need set environment variables before importing main - 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()) @app.command() From d52fc40038ddb8ee6c8c34f33b7c820f7ddf114d Mon Sep 17 00:00:00 2001 From: Adhithya <77617084+Adhithya03@users.noreply.github.com> Date: Tue, 24 Dec 2024 22:25:13 +0530 Subject: [PATCH 2/2] format --- backend/open_webui/__init__.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/backend/open_webui/__init__.py b/backend/open_webui/__init__.py index 1376859ad..cb019655a 100644 --- a/backend/open_webui/__init__.py +++ b/backend/open_webui/__init__.py @@ -13,8 +13,6 @@ app = typer.Typer() KEY_FILE = Path.cwd() / ".webui_secret_key" - - @app.command() def serve( host: str = "0.0.0.0",