This is an automated email from the ASF dual-hosted git repository.
ephraimbuddy pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/main by this push:
new 58e124b8877 Suppress noisy Alembic plugin setup logs (#69916)
58e124b8877 is described below
commit 58e124b88775314373ff5a5f0ed5432f1cbe2030
Author: Ephraim Anierobi <[email protected]>
AuthorDate: Mon Jul 20 08:53:45 2026 +0100
Suppress noisy Alembic plugin setup logs (#69916)
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.
---
shared/logging/src/airflow_shared/logging/structlog.py | 1 +
shared/logging/tests/logging/test_structlog.py | 13 +++++++++++++
2 files changed, 14 insertions(+)
diff --git a/shared/logging/src/airflow_shared/logging/structlog.py
b/shared/logging/src/airflow_shared/logging/structlog.py
index 72884cfbde7..1c4341e99e5 100644
--- a/shared/logging/src/airflow_shared/logging/structlog.py
+++ b/shared/logging/src/airflow_shared/logging/structlog.py
@@ -709,6 +709,7 @@ def configure_logging(
# These ones are too chatty even at info
"httpx": {"level": "WARN"},
"sqlalchemy.engine": {"level": "WARN"},
+ "alembic.runtime.plugins": {"level": "WARN"},
}
)
config["root"] = {
diff --git a/shared/logging/tests/logging/test_structlog.py
b/shared/logging/tests/logging/test_structlog.py
index ca85bb4f20e..cf63d2ed778 100644
--- a/shared/logging/tests/logging/test_structlog.py
+++ b/shared/logging/tests/logging/test_structlog.py
@@ -464,6 +464,19 @@ def
test_logger_respects_configured_level(structlog_config):
assert "[my_logger] Debug message\n" in written
+def test_alembic_runtime_plugin_setup_logs_are_suppressed(structlog_config):
+ with structlog_config(
+ colors=False,
+ log_format="[%(name)s] %(message)s",
+ log_level="INFO",
+ ) as sio:
+ logger = logging.getLogger("alembic.runtime.plugins")
+ logger.info("Filtered plugin setup message")
+ logger.warning("Visible warning")
+
+ assert sio.getvalue() == "[alembic.runtime.plugins] Visible warning\n"
+
+
def test_excepthook_installed_when_json_output_true(structlog_config):
import sys