Sobes.tech
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:

  1. 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.
  2. On the filesystem: By default, logs are stored in the directory specified in the Airflow configuration (airflow.cfg) under the base_log_folder parameter. Usually, this path looks like /home/airflow/airflow/logs/. Inside the folder, logs are structured by DAG, date, and task.

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