Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Airflow Remote logging not working

I have a up and running Apache - Airflow 1.8.1 instance.

I got a working connection (and it's ID) to write to Google Cloud Storage and my airflow user has the permission to write to the bucket.

I try to use the remote log storage functionality by adding

remote_base_log_folder = 'gs://my-bucket/log'

remote_log_conn_id = 'my_working_conn_id'

And that's all (I didn't touch any configuration but that)

I restarted all the services but the log aren't uploading to gcs (my bucket it's still empty) and my filesystem space is still decreasing.

Have you enabled successfully remote log with gcs? If yes, what did you change / do?

like image 783
Pierre CORBEL Avatar asked Dec 03 '25 23:12

Pierre CORBEL


1 Answers

I manage to get the remote log to GCS. First, you need to give the service account permission to write to GCS bucket.

This is my GCP connection set up:

GCP connection setup

Then, edit the airflow.cfg file:

remote_base_log_folder = gs://my-backup/airflow_logs
remote_log_conn_id = my_gcp_conn

After editing the config file, you need to re-initialize it again:

airflow initdb

# start the web server, default port is 8080
airflow webserver -p 8080

Testing by turning on the "tutorial" DAG, you should be able to see the logs both locally and remotely in GCS:

enter image description here

like image 55
Tuan Vu Avatar answered Dec 05 '25 17:12

Tuan Vu



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!