Sfoglia il codice sorgente

enh: add configurable log level for uvicorn server

Adhithya03 4 mesi fa
parent
commit
16da847342
1 ha cambiato i file con 5 aggiunte e 1 eliminazioni
  1. 5 1
      backend/open_webui/__init__.py

+ 5 - 1
backend/open_webui/__init__.py

@@ -6,11 +6,15 @@ from pathlib import Path
 import typer
 import typer
 import uvicorn
 import uvicorn
 
 
+from open_webui.env import (GLOBAL_LOG_LEVEL)
+
 app = typer.Typer()
 app = typer.Typer()
 
 
 KEY_FILE = Path.cwd() / ".webui_secret_key"
 KEY_FILE = Path.cwd() / ".webui_secret_key"
 
 
 
 
+
+
 @app.command()
 @app.command()
 def serve(
 def serve(
     host: str = "0.0.0.0",
     host: str = "0.0.0.0",
@@ -55,7 +59,7 @@ def serve(
 
 
     import open_webui.main  # we need set environment variables before importing main
     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()
 @app.command()