Railway logs

Forward the logs of your Railway services to Flowhawk with Locomotive, Railway's log forwarder template.

Railway has no log drains of its own. Locomotive is a template you add to a Railway project: it reads the logs of the services you pick and posts them to a webhook.

What you get

  • Railway logs in Logs, next to your traces and metrics, searchable with the same query language (severity>=WARN service=checkout "timeout"), grouped into patterns or followed live.
  • A log line that names a request path joins the business flow of that route, so a failing checkout shows its platform logs on the checkout flow's page.
  • A line that carries a trace id opens its trace.
  • Alert on any search with Alert on this, and let the agent read these logs when it investigates an incident.

Set it up

First create an ingest key: in the app, open Settings > API keys and pick Services. In the examples below, KEY stands for that key. Keep it out of your repository, like any other secret.

  1. In your Railway project, add the Locomotive template.
  2. Give it a Railway API token and the services to forward.
  3. Set its webhook to Flowhawk:
    LOCOMOTIVE_WEBHOOK_URL=https://api.flowhawk.dev/v1/logs/railway
    LOCOMOTIVE_ADDITIONAL_HEADERS=Authorization=Bearer KEY
    LOCOMOTIVE_WEBHOOK_MODE=json

The same steps, with your workspace's address filled in, are in the app under Settings > Integrations > Log drains.

What arrives

RailwayIn Flowhawk
Service nameThe service
Project, environment and deploymentAttributes on each line
A JSON log line from your appIts message, level, trace id and fields