Remote Logging in Apache Airflow
S3, GCS, and Azure Blob Explained βοΈπβ
The Story: Logs That Disappearβ
Your DAG ran overnight.
A task failed.
You open the Airflow UIβ¦
βLog file does not exist.β
This happens when:
- Workers restart
- Pods are rescheduled
- Nodes are auto-scaled
Local logs vanish.
Remote logs survive.
Remote logging is not a feature β itβs a requirement for any serious Airflow deployment.
What Is Remote Logging in Airflow?β
Remote logging means storing Airflow task logs in durable external storage instead of local worker disks.
Supported backends:
- Amazon S3
- Google Cloud Storage (GCS)
- Azure Blob Storage
- Elasticsearch (advanced use cases)
π Airflow streams logs to remote storage while the task is running.
Why Remote Logging Is Mandatory in Productionβ
| Problem | Local Logs | Remote Logs |
|---|---|---|
| Worker restarts | β Lost | β Safe |
| Kubernetes pods | β Ephemeral | β Persistent |
| Multi-worker access | β Inconsistent | β Centralized |
| Compliance | β Risky | β Auditable |
| Cost control | β Disk-heavy | β Lifecycle rules |
How Remote Logging Works (Architecture)β
Task Running on Worker
β Log written to local buffer
β Streamed to remote storage
β Metadata saved in DB
β Webserver reads from remote storage
β Log displayed in UI
π Airflow UI does not read logs from workers when remote logging is enabled.
Enabling Remote Logging (Core Configuration)β
Remote logging is configured in airflow.cfg or environment variables.
[logging]
remote_logging = True
remote_log_conn_id = remote_log_storage
remote_base_log_folder = s3://my-airflow-logs
π Each provider uses its own connection type.