Middle
Where can I view task logs in Airflow?
sobes.tech AI
Answer from AI
Task logs in Apache Airflow can be viewed in several ways:
-
Through the Airflow web interface:
- Go to the DAGs section.
- Select the desired DAG and click on a specific run.
- In the list of tasks, select the required task.
- Click on the "Log" icon or the "View Log" link — the task execution log will open.
-
On the filesystem: By default, logs are stored in the directory specified in the Airflow configuration (
airflow.cfg) under thebase_log_folderparameter. Usually, this path looks like/home/airflow/airflow/logs/. Inside the folder, logs are structured by DAG, date, and task. -
Via command line: You can use the CLI command:
airflow tasks logs <dag_id> <task_id> <execution_date>
Thus, for quick log viewing, it is usually most convenient to use the web interface.