enh: add configurable log level for uvicorn server

This commit is contained in:
Adhithya03 2024-12-24 22:18:31 +05:30
parent 29a2719595
commit 16da847342

View File

@ -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()