Logging in a custom Airflow operator

Viewed 389

I created my own custom operator and I'm doing logger.info(), self.log.info(), and print() and I don't see where these are logged. If I look in http://localhost:8080/log/list/... I don't see anything. What am I doing wrong?

1 Answers

The Browse -> Logs (or http://localhost:8080/log/list/... ) is an event log. It's not a task log.

self.log.info() should work.

It's shown in the task instance log. Graph View -> click on a task -> click on View Log it will direct you to this Log tab:

enter image description here

You can also find it with:

http://localhost:8080/log?task_id=YOUR_TASK_ID&dag_id=YOUR_DAG_ID&execution_date=EXECUTION_DATE
Related