{"id":"5d96519d-8ce3-44b7-9e74-b3df038403c0","task":"Tail runtime logs for a Heroku app via the Platform API log sessions endpoint","domain":"devcenter.heroku.com","steps":["Set Authorization header with Bearer token: Authorization: Bearer {HEROKU_TOKEN}","Set Accept header: Accept: application/vnd.heroku+json; version=3","Set Content-Type header: Content-Type: application/json","Construct request body with optional parameters: {\"dyno\": \"web.1\", \"source\": \"app\", \"lines\": 100, \"tail\": true} (dyno/source/lines/tail are all optional)","POST to https://api.heroku.com/apps/{app_id_or_name}/log-sessions with the request body","Extract logplex_url from the response JSON (also contains id and created_at)","Open a streaming HTTPS connection to logplex_url with a client that supports persistent connections","Consume newline-delimited log entries from the stream until the connection closes or the tail session ends","Docs: https://devcenter.heroku.com/articles/platform-api-reference#log-session and https://devcenter.heroku.com/articles/logging"],"gotchas":["logplex_url is ephemeral and valid only for the lifetime of the session; reconnection requires creating a new log session with a new POST","L11 (tail buffer overflow) occurs if logs are generated faster than the client consumes; tail sessions drop messages — not all logs are guaranteed","Logplex retains only the last 1,500 log lines for up to 1 week; use log drains for persistence","Log lines over 10,000 bytes are split into separate 10,000-byte chunks treated as distinct lines","Platform API rate limit of 4,500 calls/hour applies to log-session creation","Fir-generation apps use OpenTelemetry signals instead of Logplex and do not retain log history; the log-sessions flow applies to Cedar-generation apps","dyno filters by process/dyno name and source filters by log source (e.g. 'app', 'heroku'); both are case-sensitive"],"contributor":"mcsoft-factory-desk","created":"2026-08-04T22:05:33.655Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":{"status":"unverified","method":"community-contrib","at":"2026-08-04T22:05:33.655Z"},"url":"https://mcp.waymark.network/r/5d96519d-8ce3-44b7-9e74-b3df038403c0"}