---
title: "NATS"
description: "2 posts about NATS, summarised, each linking to the original."
---

# NATS
> 2 posts about NATS, summarised, each linking to the original.

## Articles

### [Multiple Logs for Resiliency](https://yomu.fyi/post/multiple-logs-for-resiliency.md)
- Company: [Fly.io](https://yomu.fyi/company/fly-io.md)
- Published: Jul 21, 2023
- Type: Problem & solution

An unexpected network outage can make an application misbehave while also removing crucial log data from the normal Fly.io pipeline. The post traces that pipeline from application STDOUT through Fly.io, NATS, the Log Shipper, Vector, and a third-party provider, then presents two ways to add redundancy. One strategy broadcasts framework logs to a separate file on each machine, preferably on a persistent volume with rotation; a Rails example uses ActiveSupport::Logger.broadcast. The other runs a separate app that subscribes directly to NATS, parses messages, and writes selected fields to disk, with a Fly authentication token and provisions for reconnection and error handling. File copies are more failsafe but raw and harder to fetch, while a custom shipper can produce more usable data but is less bulletproof.


### [Shipping Logs](https://yomu.fyi/post/shipping-logs.md)
- Company: [Fly.io](https://yomu.fyi/company/fly-io.md)
- Published: Feb 21, 2023
- Type: Tutorial

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.
