Ankurdeewan commented on issue #59634:
URL: https://github.com/apache/airflow/issues/59634#issuecomment-3685582498

   In Airflow 3.x, task execution runs in an isolated context via the Task SDK, 
and only task-scoped loggers are guaranteed to be captured in task logs.
   
   For operators, the supported and recommended way to log is using self.log. 
This logger is explicitly tied to the task instance and is correctly routed to 
task logs.
   
   LoggingMixin can be used for non-operator helper or utility classes, but it 
is not a replacement for task-scoped logging inside operators.
   
   Module-level loggers created via logging.getLogger(__name__), which worked 
in Airflow 2.x, are no longer guaranteed to be captured during task execution 
in Airflow 3.x due to this isolation.
   
   I agree that the silent loss of such logs can be confusing for users 
migrating from 2.x, and this behavior likely needs clearer documentation or 
guidance, but functionally self.log is the correct approach going forward.


-- 
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