Suppress noisy Alembic plugin setup logs#69916
Conversation
There was a problem hiding this comment.
Pull request overview
This PR fixes CLI machine-readable output (e.g. --output json) being polluted by stdlib-logging output from dependencies (notably Alembic), by making [logging] namespace_levels apply consistently to both structlog and Python’s standard-library logging loggers. It also lowers the handler threshold when needed so per-namespace verbosity can be higher than the global level without being dropped.
Changes:
- Apply
namespace_levelsto stdlib loggers by setting per-logger levels afterdictConfig, and adjust the default handler level to the most verbose configured level so overrides can take effect. - Default
alembic.runtime.pluginstoWARNINGto suppress noisy plugin-registration logs during normal CLI commands. - Add regression tests for stdlib namespace filtering and the Alembic default; update config docs to reflect behavior and namespace hierarchy.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| shared/logging/src/airflow_shared/logging/structlog.py | Applies namespace levels to stdlib loggers, lowers handler threshold when required, and suppresses Alembic plugin logs by default. |
| shared/logging/tests/logging/test_structlog.py | Adds tests covering stdlib namespace filtering, allowing per-namespace verbosity below the global level, and the Alembic logger default. |
| airflow-core/src/airflow/config_templates/config.yml | Documents that namespace_levels applies to both structlog and stdlib logging and clarifies hierarchical namespace behavior. |
|
Wrong fix IMO -- why is |
Alembic emits autogenerate plugin registration messages at INFO during CLI startup. Those unrelated lines contaminate machine-readable command output, while warnings and errors still need to remain visible.
8c4fb25 to
c994939
Compare
Backport successfully created: v3-3-testNote: As of Merging PRs targeted for Airflow 3.X In matter of doubt please ask in #release-management Slack channel.
|
Alembic emits autogenerate plugin registration messages at INFO during CLI startup. Those unrelated lines contaminate machine-readable command output, while warnings and errors still need to remain visible. (cherry picked from commit 58e124b) Co-authored-by: Ephraim Anierobi <splendidzigy24@gmail.com>
Alembic emits autogenerate plugin registration messages at INFO during CLI startup. Those unrelated lines contaminate machine-readable command output, while warnings and errors still need to remain visible. (cherry picked from commit 58e124b) Co-authored-by: Ephraim Anierobi <splendidzigy24@gmail.com>
Alembic emits autogenerate plugin registration messages at INFO during CLI startup. Those unrelated lines contaminate machine-readable command output, while warnings and errors still need to remain visible.
Alembic emits autogenerate plugin registration messages at INFO during CLI startup. Those unrelated lines contaminate machine-readable command output, while warnings and errors still need to remain visible.
closes: #69911
Was generative AI tooling used to co-author this PR?
GPT-5.6