The GitHub Actions job "Tests" on 
airflow.git/fix/dag-callback-logging-airflow-3x has failed.
Run started by GitHub user Arunodoy18 (triggered by Arunodoy18).

Head commit for run:
38ee475c467a2e333f8a86fbd9389c442adb7075 / Arunodoy18 <[email protected]>
Fix missing logs from DAG.on_failure_callback in Airflow 3.x

DAG-level failure callbacks are executed outside of any TaskInstance
context, which means no log handlers are attached. This caused all
logging calls inside the callback to be silently dropped.

This commit adds a logging context manager that redirects Python
logging calls from DAG callbacks to the DAG file parsing log.

Changes:
- Added _redirect_callback_logs_to_dag_parsing_log() context manager
  in processor.py that forwards to structlog logger
- Updated _redirect_callback_logs_to_scheduler() in dagrun.py with
  clarified documentation for dag.test() scenarios
- Wrapped callback execution with the logging context
- Log messages are prefixed with [DAG Callback] for identification
- Added unit tests to verify log capture in both code paths

Logs from DAG callbacks executed during DAG file parsing now appear
in the DAG file parsing log. Logs from callbacks during dag.test()
appear in scheduler logs. No API changes or configuration required.

Addresses feedback from maintainers to route logs to DAG parsing log
instead of generic scheduler logs.

Report URL: https://github.com/apache/airflow/actions/runs/21337814320

With regards,
GitHub Actions via GitBox


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to