<br />

<br />


[Managed Airflow (Gen 3)](https://docs.cloud.google.com/composer/docs/composer-3/view-logs "View this page for Managed Airflow (Gen 3)") \| **Managed Airflow (Gen 2)** \| [Managed Airflow (Legacy Gen 1)](https://docs.cloud.google.com/composer/docs/composer-1/view-logs "View this page for Managed Airflow (Legacy Gen 1)")

<br />

<br />

<br />

<br />

<br />

<br />

This page describes how to access and view Apache Airflow logs for
Managed Service for Apache Airflow.

## About log types

Managed Service for Apache Airflow has the following Airflow logs:

- [Streaming logs](https://docs.cloud.google.com/composer/docs/composer-2/view-logs#streaming). These logs contain Airflow task logs, as well
  as logs of Airflow components of your environment, such as Airflow
  schedulers and workers.

  To learn about Cloud Logging and Cloud Monitoring for your
  Managed Airflow environment, see
  [Monitor environments](https://docs.cloud.google.com/composer/docs/composer-2/monitor-environments).
- [Airflow task logs in the environment's bucket](https://docs.cloud.google.com/composer/docs/composer-2/view-logs#view-bucket). These logs are
  associated with single DAG tasks.

  If you
  [enable saving logs to the environment's bucket](https://docs.cloud.google.com/composer/docs/composer-2/enable-saving-logs-to-environment-bucket),
  Managed Airflow saves files with Airflow task logs to the `/logs`
  folder.

- Managed Service for Apache Airflow generates [audit logs](https://docs.cloud.google.com/logging/docs/audit), such as Admin
  Activity logs. For more information, see
  [View audit logs](https://docs.cloud.google.com/composer/docs/composer-2/audit-logging).

## Before you begin

<br />

- Your Google Account must have a role that can view objects in environment
  buckets. For more information, see [Access control](https://docs.cloud.google.com/composer/docs/composer-2/access-control).

- Logs stored in environment's bucket use the policy of the bucket.
  Managed Airflow creates buckets with the default policy that keeps
  data forever. For logs stored in Cloud Logging,
  Managed Airflow uses `_Default` and User-defined
  [logs retention periods](https://docs.cloud.google.com/logging/quotas#logs_retention_periods).

- To prevent data loss, logs saved in environment's bucket
  **are not deleted after you delete your environment**. You must manually
  delete logs from your environment's bucket.

## View streaming logs

To view streaming logs in Cloud Logging:

### Console

1. In the Google Cloud console, go to the **Environments** page.

   [Go to Environments](https://console.cloud.google.com/composer/environments)
2. In the list of environments, click the name of your environment.
   The **Environment details** page opens.

3. Go to the **Logs** tab.

## View streaming logs in Cloud Logging

To view streaming logs in Cloud Logging:

### Console

1. In the Google Cloud console, go to the **Environments** page.

   [Go to Environments](https://console.cloud.google.com/composer/environments)
2. In the list of environments, locate your environment.

3. in the **Logs** column, click the **Logs** link.

## View Airflow task logs in the environment's bucket

> [!NOTE]
> **Note:** You can view Airflow task logs [in the Airflow UI](https://docs.cloud.google.com/composer/docs/composer-2/access-airflow-web-interface).

To view Airflow task logs in your environment's bucket:

### Console

1. In Google Cloud console, go to the **Environments** page.

   [Go to Environments](https://console.cloud.google.com/composer/environments)
2. In the list of environments, find a row with the name of your environment
   and in the **DAGs folder** column click the **DAGs** link. The
   **Bucket details** page opens.

3. In the **Folder browser** pane, click `/logs`.

   > [!NOTE]
   > **Note:** If this folder is empty, then [saving logs to the environment's bucket](https://docs.cloud.google.com/composer/docs/composer-2/enable-saving-logs-to-environment-bucket) might be disabled for your environment.

## What's next

- [Monitor environments](https://docs.cloud.google.com/composer/docs/composer-2/monitor-environments)
- [Managed Service for Apache Airflow audit logging](https://docs.cloud.google.com/composer/docs/composer-2/audit-logging)