Skip to content

everything you need to ship logs from fly.io app instances to GCP, S3, or BetterStack (basically https://github.com/superfly/fly-log-shipper but with the configurations I prefer)

License

Notifications You must be signed in to change notification settings

cameront/fly-log-shipper-prefork

Repository files navigation

fly-log-shipper

everything you need to ship logs from fly.io app instances to GCP, S3, or BetterStack (basically https://github.com/superfly/fly-log-shipper but with the configurations I prefer)

Setting up GCP

Use gcloud command line to...

  1. Create a new logging bucket that will eventually store logs
gcloud logging buckets create my-new-logs-bucket --location=global --retention-days=180 --description="some description"
  1. Create a new logging sink that will receive the logs from the shipper and write them to the bucket
gcloud logging sinks create my-new-log-sink my-new-logs-bucket [--description=DESCRIPTION]  --project=PROJECT_ID
  1. Create a new service account user
gcloud iam service-accounts create your-service-user-name --description="DESCRIPTION"  --display-name="DISPLAY_NAME"
  1. Create service account credentials for the user, and prepare to ship those in this docker container
gcloud iam service-accounts keys create ./gcp_logging_user_credentials.json --iam-account=your-service-user-name@your-project.iam.gserviceaccount.com
  1. Grant the service account the ability to write logs
gcloud projects add-iam-policy-binding PROJECT_ID --member=serviceAccount:your-service-user-name@PROJECT_ID.iam.gserviceaccount.com --role=roles/logging.logWriter

Then bake the credentials file in the docker container, set your GOOGLE_CREDNETIALS env var, and deploy

About

everything you need to ship logs from fly.io app instances to GCP, S3, or BetterStack (basically https://github.com/superfly/fly-log-shipper but with the configurations I prefer)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published