mirror of
https://github.com/open-webui/open-webui.git
synced 2026-02-24 12:11:56 +01:00
* feat: add LOG_FORMAT env var with JSON formatter for early logging Introduce LOG_FORMAT environment variable (set to "json" to enable). When active, logging.basicConfig() uses a JSONFormatter that outputs single-line JSON objects with fields: ts, level, msg, caller, error, stacktrace. This covers all log messages emitted during module imports before Loguru's start_logger() takes over. * feat: add JSON sink for Loguru when LOG_FORMAT=json Add _json_sink() as a Loguru sink function that writes single-line JSON to stdout. In start_logger(), conditionally use the JSON sink instead of the plain-text stdout_format when LOG_FORMAT is set to "json". * feat: suppress ASCII banner and fix alembic logging in JSON mode - Wrap the ASCII art banner print in main.py with a LOG_FORMAT != "json" guard so JSON output stays machine-parseable. - Skip alembic's fileConfig() call in migrations/env.py when LOG_FORMAT=json to prevent it from replacing the JSON log handlers installed during early startup.
Generic single-database configuration. Create new migrations with DATABASE_URL=<replace with actual url> alembic revision --autogenerate -m "a description"