{"id":20698115,"url":"https://github.com/fly-apps/fly-log-local","last_synced_at":"2025-12-16T06:17:04.353Z","repository":{"id":104276908,"uuid":"526290923","full_name":"fly-apps/fly-log-local","owner":"fly-apps","description":"Store Fly app logs locally.","archived":false,"fork":false,"pushed_at":"2022-11-13T18:59:09.000Z","size":3,"stargazers_count":13,"open_issues_count":3,"forks_count":3,"subscribers_count":10,"default_branch":"main","last_synced_at":"2025-01-17T18:56:23.993Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Dockerfile","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fly-apps.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-08-18T16:31:44.000Z","updated_at":"2024-02-29T12:25:58.000Z","dependencies_parsed_at":null,"dependency_job_id":"d17d4acf-f0e6-450d-bbeb-c43d2645dd76","html_url":"https://github.com/fly-apps/fly-log-local","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fly-apps%2Ffly-log-local","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fly-apps%2Ffly-log-local/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fly-apps%2Ffly-log-local/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fly-apps%2Ffly-log-local/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fly-apps","download_url":"https://codeload.github.com/fly-apps/fly-log-local/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242967659,"owners_count":20214280,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-17T00:22:51.777Z","updated_at":"2025-12-16T06:16:59.323Z","avatar_url":"https://github.com/fly-apps.png","language":"Dockerfile","funding_links":[],"categories":[],"sub_categories":[],"readme":"# fly-log-local\n\nLocal logging at Fly using Vector and Loki.\n\nThis app reads the [Fly NATS endpoint](https://community.fly.io/t/fly-logs-over-nats/1540) using [Vector](https://vector.dev/docs/reference/configuration/sources/nats/) which then sends to [Loki](https://grafana.com/docs/loki/latest/) for the datastore on the attached volume.  The logs can later be accessed via [Logcli](https://grafana.com/docs/loki/latest/tools/logcli/) or any other Loki client.  In this example the Loki endpoint is running without authentication and only accessible via [fly proxy](https://fly.io/docs/flyctl/proxy/).\n\n\n## Quickstart\n\n#### Create Fly app\n```\nfly apps create \u003cinsert-app-name\u003e\n```\n\n#### Edit fly.toml\n\nUpdate the app name.\n```\napp = \"\u003cinsert-app-name\u003e\"\n```\n\n#### Create volume\n```\nfly volumes create log_data\n```\n\n#### Create secret\n\n```\nfly secrets set ACCESS_TOKEN=$(fly auth token)\n```\n\n#### Scale memory ( optional )\n\n```\nfly scale memory 512\n```\n\n#### Deploy\n\n```\nfly deploy\n```\n\n#### Install logcli\n\n```\nbrew install logcli\n```\n\n#### Start proxy\n\n```\nfly proxy 3100:3100\n```\n\n#### Search loki\n\nTailing all app logs.\n```\n~/ logcli query -z UTC -q '{forwarder=\"vector\"}' -t\n2022-08-18T14:33:35Z {fly_app=\"fly-log-local-example\", fly_instance=\"c1046e0d\", forwarder=\"vector\"} 2022-08-18 14:33:35,571 INFO success: loki entered RUNNING state, process has stayed up for \u003e than 1 seconds (startsecs)\n2022-08-18T14:33:35Z {fly_app=\"fly-log-local-example\", fly_instance=\"c1046e0d\", forwarder=\"vector\"} 2022-08-18 14:33:35,572 INFO success: vector entered RUNNING state, process has stayed up for \u003e than 1 seconds (startsecs)\n2022-08-18T14:40:51Z {fly_app=\"bold-star-5487\", fly_instance=\"97200383\", forwarder=\"vector\"} Starting instance\n2022-08-18T14:40:58Z {fly_app=\"bold-star-5487\", fly_instance=\"97200383\", forwarder=\"vector\"} Configuring virtual machine\n2022-08-18T14:40:58Z {fly_app=\"bold-star-5487\", fly_instance=\"97200383\", forwarder=\"vector\"} Pulling container image\n2022-08-18T14:40:58Z {fly_app=\"bold-star-5487\", fly_instance=\"97200383\", forwarder=\"vector\"} Unpacking image\n2022-08-18T14:40:58Z {fly_app=\"bold-star-5487\", fly_instance=\"97200383\", forwarder=\"vector\"} Preparing kernel init\n2022-08-18T14:40:59Z {fly_app=\"bold-star-5487\", fly_instance=\"97200383\", forwarder=\"vector\"} Configuring firecracker\n2022-08-18T14:40:59Z {fly_app=\"bold-star-5487\", fly_instance=\"97200383\", forwarder=\"vector\"} Starting virtual machine\n2022-08-18T14:40:59Z {fly_app=\"bold-star-5487\", fly_instance=\"97200383\", forwarder=\"vector\"} Starting init (commit: 9b0a951)...\n...\n```\n\n\nSpecific app and from time.\n```\n~/ logcli query -z UTC -q --from=\"2022-08-18T14:30:00Z\" '{fly_app=\"fly-log-local-example\"}'\n2022-08-18T14:33:35Z {} 2022-08-18 14:33:35,572 INFO success: vector entered RUNNING state, process has stayed up for \u003e than 1 seconds (startsecs)\n2022-08-18T14:33:35Z {} 2022-08-18 14:33:35,571 INFO success: loki entered RUNNING state, process has stayed up for \u003e than 1 seconds (startsecs)\n```\n\nAdditional documentation can be found here: https://grafana.com/docs/loki/latest/tools/logcli/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffly-apps%2Ffly-log-local","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffly-apps%2Ffly-log-local","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffly-apps%2Ffly-log-local/lists"}