Log drain
A pipe that forwards a hosting platform's stdout and stderr logs to an external log service or archive.
See it
What it is
A log drain is a platform-managed pipe that forwards an app's log stream to an external destination, usually over HTTPS or syslog. Your app writes to stdout and stderr; the platform collects those lines and sends them to a log store, security system, or archive. Heroku's Logplex made the term familiar, and other hosting platforms offer the same pattern under names such as log streaming or forwarding.
Use one on managed or ephemeral infrastructure where installing a shipping agent is awkward and local logs disappear with the instance. Keep the app side simple: emit structured JSON to stdout, configure one drain at the platform boundary, and let the destination index and retain it. A drain is transport, not storage; search, parsing, retention, and alerts belong to the receiving system.
Gotcha: the pipe can fail or fall behind while the app keeps serving traffic. Monitor delivery errors at both ends and understand what the platform drops when the destination is slow. Treat the endpoint as sensitive, use TLS and authentication, and scrub secrets before stdout. Once a token enters the drain, it may already be copied into several systems.
Ask AI for it
Configure an HTTPS log drain for this Heroku Cedar app. Make the app emit one structured JSON object per line to stdout and stderr, then add the authenticated HTTPS endpoint with `heroku drains:add` and verify it with `heroku drains`. Include service, environment, release, level, message, timestamp, and request_id in each record. Redact authorization headers, cookies, passwords, tokens, and email addresses before writing to stdout. Add a synthetic log record with a unique marker, confirm it arrives at the destination, and document how to rotate the endpoint credential without losing the drain configuration.