Arunodoy18 commented on issue #60969:
URL: https://github.com/apache/airflow/issues/60969#issuecomment-3796025591

   Thanks for reporting this - I can reproduce the behavior on Airflow 3.1.6.
   
   The DAG.on_failure_callback is executed outside of a TaskInstance context 
(scheduler/DAG processing side), so there is no task log handler attached when 
the callback runs. As a result, print() and logging calls inside the DAG-level 
callback are effectively dropped and do not appear in either task logs or 
scheduler logs, even though the callback itself is executed (confirmed via file 
I/O side effects).
   
   This seems to be a logging context gap specific to DAG-level callbacks in 
Airflow 3.x. Task-level on_failure_callback logs correctly, which further 
suggests the issue is not with user code but with how logging is wired for DAG 
callbacks.
   
   Expected behavior would be for DAG-level failure callbacks to emit logs to 
at least the scheduler logs, or for Airflow to provide a dedicated 
logger/context for DAG callbacks.
   
   I’d be happy to work on a PR if there is alignment on where DAG callback 
logs should be routed (e.g. scheduler logger vs a dedicated DAG callback 
logger).


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to