0

I'm creating a fairly complex task using the task-flow API (@task annotation) and I need to write some logs which will help me troubleshooting the runs during development and in the future.

I've researched the subject and found nothing in the official documentation or in articles/ blog posts.

What's the idiomatic way to write logs which will show up in the task logs when using the task-flow API?

EDIT: It seems that print() statements from within the function are logged as INFO statements from logging_mixin. I still think there should be a more appropriate way to log.

cosenmarco
  • 125
  • 9

1 Answers1

1

You need to get task logger:

log = logging.getlogger("airflow.task")
Jarek Potiuk
  • 19,317
  • 2
  • 60
  • 61