Fly.ioTutorial
Shipping Logs
Summary
Shipping Logs describes how Fly.io application stdout moves through the platform and how to centralize and retain it beyond Fly.io’s log lifetime. Apps run in Firecracker VMs, where an injected Rust init process captures stdout and sends it through host-side Go code to Vector, which publishes the logs to an internal NATS cluster; Flaps limits access to an organization’s logs. The Fly Log Shipper runs Vector as a NATS client and forwards organization-wide streams to a configured sink such as Logtail, Loki, Datadog, or Cloudwatch, using secrets for provider credentials. Deployment involves launching the image, removing the generated services section, adding an internal port, and running fly deploy. A SUBJECT environment variable can narrow collection with NATS subjects such as logs.sandwich.>, covering an app across regions and instances.
Context
Fly.io applications can generate substantial output, and centralizing logs supports correlating events across services and retaining logs beyond Fly.io’s retention period.
Approach / What changed
Run the Fly Log Shipper image, configure Vector sinks through secrets, connect to the organization-scoped NATS log stream through Flaps, and optionally set a SUBJECT environment variable to select specific application logs.
Takeaways
The log path runs from application stdout through the VM’s Rust init process, host-side Go code, Vector, NATS, and the Flaps access proxy.
The Fly Log Shipper can forward organization-wide logs to sinks including Logtail, Loki, Datadog, and Cloudwatch, with provider configuration supplied through secrets.
NATS subjects can filter logs by application; logs.sandwich.> matches the sandwich app across regions and instances.
Source and freshness
- Source
- fly.io
- Published
- Added to Yomu
- Last updated
Summaries are generated from the original by a language model. Check the original before relying on it.
Keep reading
Related reading
The Good Stuff
Paid picks we use ourselves. Links carry a referral code — a subscription through one earns us a commission at no extra cost to you.
The best engineering reads, once a week
One useful email. Unsubscribe anytime.