Skip to main content

Understanding Open WebUI Logging πŸͺ΅

Logging is essential for debugging, monitoring, and understanding how Open WebUI is behaving. This guide explains how logging works in both the browser client (frontend) and the application server/backend.

πŸ–₯️ Browser Client Logging (Frontend)​

For frontend development and debugging, Open WebUI utilizes standard browser console logging. This means you can see logs directly within your web browser's built-in developer tools.

How to Access Browser Logs:

  1. Open Developer Tools: In most browsers, you can open developer tools by:

    • Right-clicking anywhere on the Open WebUI page and selecting "Inspect" or "Inspect Element".
    • Pressing F12 (or Cmd+Opt+I on macOS).
  2. Navigate to the "Console" Tab: Within the developer tools panel, find and click on the "Console" tab.

Types of Browser Logs:

Open WebUI primarily uses JavaScript's console.log() for client-side logging. You'll see various types of messages in the console, including:

  • Informational messages: General application flow and status.
  • Warnings: Potential issues or non-critical errors.
  • Errors: Problems that might be affecting functionality.

Browser-Specific Developer Tools:

Different browsers offer slightly different developer tools, but they all provide a console for viewing JavaScript logs. Here are links to documentation for popular browsers:

βš™οΈ Application Server/Backend Logging (Python)​

The backend of Open WebUI uses Python's built-in logging module to record events and information on the server side. These logs are crucial for understanding server behavior, diagnosing errors, and monitoring performance.

Key Concepts:

  • Python logging Module: Open WebUI leverages the standard Python logging library. If you're familiar with Python logging, you'll find this section straightforward. (For more in-depth information, see the Python Logging Documentation).
  • Console Output: By default, backend logs are sent to the console (standard output), making them visible in your terminal or Docker container logs.
  • Logging Levels: Logging levels control the verbosity of the logs. You can configure Open WebUI to show more or less detailed information based on these levels.

🚦 Logging Levels Explained​

Python logging uses a hierarchy of levels to categorize log messages by severity. Here's a breakdown of the levels, from most to least severe:

LevelNumeric ValueDescriptionUse Case
CRITICAL50Severe errors that may lead to application termination.Catastrophic failures, data corruption.
ERROR40Errors that indicate problems but the application might still function.Recoverable errors, failed operations.
WARNING30Potential issues or unexpected situations that should be investigated.Deprecation warnings, resource constraints.
INFO20General informational messages about application operation.Startup messages, key events, normal operation flow.
DEBUG10Detailed debugging information for developers.Function calls, variable values, detailed execution steps.
NOTSET0All messages are logged. (Usually defaults to WARNING if not set).Useful for capturing absolutely everything, typically for very specific debugging.

Default Level: Open WebUI's default logging level is INFO.

🌍 Global Logging Level (GLOBAL_LOG_LEVEL)​

You can change the global logging level for the entire Open WebUI backend using the GLOBAL_LOG_LEVEL environment variable. This is the most straightforward way to control overall logging verbosity.

How it Works:

Setting GLOBAL_LOG_LEVEL configures the root logger in Python, affecting all loggers in Open WebUI and potentially some third-party libraries that use basicConfig. It uses logging.basicConfig(force=True), which means it will override any existing root logger configuration.

Example: Setting to DEBUG

  • Docker Parameter:

    --env GLOBAL_LOG_LEVEL="DEBUG"
  • Docker Compose (docker-compose.yml):

    environment:
    - GLOBAL_LOG_LEVEL=DEBUG

Impact: Setting GLOBAL_LOG_LEVEL to DEBUG will produce the most verbose logs, including detailed information that is helpful for development and troubleshooting. For production environments, INFO or WARNING might be more appropriate to reduce log volume.

βš™οΈ App/Backend Specific Logging Levels​

For more granular control, Open WebUI provides environment variables to set logging levels for specific backend components. Logging is an ongoing work-in-progress, but some level of control is made available using these environment variables. These variables allow you to fine-tune logging for different parts of the application.

Available Environment Variables:

Environment VariableComponent/ModuleDescription
AUDIO_LOG_LEVELAudio processingLogging related to audio transcription (faster-whisper), text-to-speech (TTS), and audio handling.
COMFYUI_LOG_LEVELComfyUI IntegrationLogging for interactions with ComfyUI, if you are using this integration.
CONFIG_LOG_LEVELConfiguration ManagementLogging related to loading and processing Open WebUI configuration files.
DB_LOG_LEVELDatabase Operations (Peewee)Logging for database interactions using the Peewee ORM (Object-Relational Mapper).
IMAGES_LOG_LEVELImage Generation (AUTOMATIC1111/Stable Diffusion)Logging for image generation tasks, especially when using AUTOMATIC1111 Stable Diffusion integration.
MAIN_LOG_LEVELMain Application Execution (Root Logger)Logging from the main application entry point and root logger.
MODELS_LOG_LEVELModel ManagementLogging related to loading, managing, and interacting with language models (LLMs), including authentication.
OLLAMA_LOG_LEVELOllama Backend IntegrationLogging for communication and interaction with the Ollama backend.
OPENAI_LOG_LEVELOpenAI API IntegrationLogging for interactions with the OpenAI API (e.g., for models like GPT).
RAG_LOG_LEVELRetrieval-Augmented Generation (RAG)Logging for the RAG pipeline, including Chroma vector database and Sentence-Transformers.
WEBHOOK_LOG_LEVELAuthentication WebhookExtended logging for authentication webhook functionality.

How to Use:

You can set these environment variables in the same way as GLOBAL_LOG_LEVEL (Docker parameters, Docker Compose environment section). For example, to get more detailed logging for Ollama interactions, you could set:

environment:
- OLLAMA_LOG_LEVEL=DEBUG

Important Note: Unlike GLOBAL_LOG_LEVEL, these app-specific variables might not affect logging from all third-party modules. They primarily control logging within Open WebUI's codebase.

By understanding and utilizing these logging mechanisms, you can effectively monitor, debug, and gain insights into your Open WebUI instance.