Skip to content

fix: apply APP_LOG_LEVEL to framework loggers too#35

Merged
aliev merged 1 commit into
mainfrom
fix/log-level-also-controls-vision-agents-loggers
May 15, 2026
Merged

fix: apply APP_LOG_LEVEL to framework loggers too#35
aliev merged 1 commit into
mainfrom
fix/log-level-also-controls-vision-agents-loggers

Conversation

@aliev

@aliev aliev commented May 15, 2026

Copy link
Copy Markdown
Member

logging.basicConfig only configures the root logger. Live logs from the deployed pod still streamed INFO in the framework's loguru-style format despite APP_LOG_LEVEL=WARNING:

HH:MM:SS.mmm | INFO     | Started server process [PID]
HH:MM:SS.mmm | INFO     | <addr> | "GET /health" 200 OK

Runner.cli() calls vision_agents.core.utils.logging.configure_sdk_logger and configure_fastapi_loggers. Both install their own StreamHandler on the vision_agents, fastapi, uvicorn, uvicorn.access, and uvicorn.error loggers and set propagate=False. Root-level basicConfig never reaches them.

Both helpers contain the guard:

if _logger.level == logging.NOTSET:
    _logger.setLevel(level)

So pre-setting the level explicitly survives the framework's setup. Loop over the five loggers and apply _log_level to each before Runner.cli() runs.

`logging.basicConfig` only configures the root logger. Live logs from
the deployed pod still streamed INFO in the framework's loguru-style
format despite `APP_LOG_LEVEL=WARNING`, e.g.:

    HH:MM:SS.mmm | INFO     | Started server process [PID]
    HH:MM:SS.mmm | INFO     | <addr> | "GET /health" 200 OK

Tracing it: `Runner.cli()` calls
`vision_agents.core.utils.logging.configure_sdk_logger` and
`configure_fastapi_loggers`. Both install their own `StreamHandler`
on the `vision_agents`, `fastapi`, `uvicorn`, `uvicorn.access`, and
`uvicorn.error` loggers and set `propagate=False`. Root-level
`basicConfig` never reaches them.

Both helpers contain the guard:

    if _logger.level == logging.NOTSET:
        _logger.setLevel(level)

So pre-setting the level explicitly survives the framework's setup.
Loop over the five loggers and apply `_log_level` to each before
`Runner.cli()` runs.
@vercel

vercel Bot commented May 15, 2026

Copy link
Copy Markdown

@aliev must be a member of the GetStreamio team on Vercel to deploy.
- Click here to add @aliev to the team.
- If you initiated this build, request access.

Learn more about collaboration on Vercel and other options here.

@aliev aliev marked this pull request as ready for review May 15, 2026 11:08
@aliev aliev merged commit afb9c92 into main May 15, 2026
2 of 3 checks passed
@aliev aliev deleted the fix/log-level-also-controls-vision-agents-loggers branch May 15, 2026 11:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant