Railway keeps logs for 3 days on Free, 7 days on Trial and Hobby, 30 days on Pro and up to 90 days on Enterprise. You can search them with a filter syntax, but Railway cannot alert on a log line and has no log drain. To keep your logs and get alerted on errors, export them over OpenTelemetry.1,3
That covers most small teams on Railway: the log view is fine for looking at what just happened, and thin for anything older than your plan's window or anything you want to hear about without looking. This post sets out what Railway gives you for logs today, from its own docs, then the setup that sends them somewhere that keeps them, groups the errors and tells you when something breaks. If you would rather not do it by hand, paste "Read fixter.dev/llms.txt and set up Fixter." into Claude Code or Cursor in your project.14
What Railway gives you for logs
Railway collects what each service writes to stdout and stderr. A line with a level field in structured JSON is coloured by that level; anything on stderr without one becomes an error, and stdout becomes info.1 How long you can look back depends on the plan:1,2
| Railway on its own | Railway plus Fixter (fixter.dev) | |
|---|---|---|
| How long logs last | 3 days on Free, 7 on Trial and Hobby, 30 on Pro, up to 90 on Enterprise | Set by your Fixter plan, not by your Railway plan |
| Search | Filter syntax in the Log Explorer and the CLI: text, @attribute:value, AND, OR, negation, numeric ranges on JSON fields | Search in the Logs page, or ask your coding agent in plain language over MCP |
| Alerts on what the logs say | None. Monitors cover CPU, RAM, disk and network egress, on Pro | Rules on logs, traces or metrics, plus automatic alerts on error bursts and anomalies |
| The same error a thousand times | A thousand lines | One issue with a count |
| Where alerts arrive | Email, in the app, or a webhook | Email or Slack |
| Traces | Edge traces, and app spans through a preview feature that takes traces only | Traces next to the logs; a log line opens the trace it came from |
| Getting logs out | No log drain: an SDK in the app, or a forwarder service such as Vector or Fluent Bit | Fixter is where they go, over standard OpenTelemetry |
| After something breaks | You open the logs and look | What broke and why, ready to fix from your coding agent or as a pull request ready for your review |
Railway column from Railway's docs and pricing page, Fixter column from Fixter's docs, November 20, 2026.1,2,3,4,6,7,11,12,13
Three limits are worth knowing before something goes wrong. Railway drops log lines above 500 per second per replica, on every plan, and shows a warning when it does.1 Its monitors, the one alerting feature, watch resources and not what your app says, and they need Pro.3 Webhooks fire on deployment status changes, volume usage and those monitors, which covers a failed deploy but not an error your code logs while the deploy looks healthy.4 Resource metrics go back up to 30 days.5
Searching Railway logs
Within the retention window, Railway's search is decent. The Log Explorer and railway logs share one filter syntax: plain text or a quoted phrase, @attribute:value for fields of structured JSON logs, AND, OR and - for negation, and comparisons such as >= or ranges with .. on numeric fields.1 The CLI adds --since and --until for a time range, --json for output a script or a coding agent can read, and separate flags for HTTP, network and DNS logs.9
Your coding agent can run these commands too, and Railway has an MCP server (railway mcp install) whose local version includes a get_logs tool.10 Either way it reads the same logs, so it sees the same window: an error from five days ago on Hobby is gone. For reading production logs from Claude Code in general, see how to connect Claude Code to your logs.
Keep your logs and get alerted: the setup in five steps
Railway has no log drain, so the logs leave from inside your app. Railway's own guide gives two ways: a vendor SDK, or OpenTelemetry with the OTLP variables set on the service.7 The steps below use OpenTelemetry and send to Fixter. Nothing in them is specific to Railway except where the variables and the start command go.7,11
- Log through a library OpenTelemetry can export. Traces come from instrumentation; logs need a bridge from your logging library. In Node that means Pino, Winston or Bunyan, and plain
console.logsends nothing. In Python,opentelemetry-bootstrapadds the instrumentation that bridges the standardloggingmodule, and log records export onceOTEL_LOGS_EXPORTER=otlpis set. The Java agent bridges logback and log4j2. Go, PHP and Ruby have no stable log bridge yet.11 The full instrumentation for each framework is in OpenTelemetry for Node.js and OpenTelemetry for Python. - Create an API key. In the Fixter app, open Settings, API keys and create one. It starts with
fixter_sk_and is shown once.11 - Add the variables to your Railway service. Open the service's Variables tab and add each one with New Variable: the name, then the value.8
The first four are the standard OpenTelemetry variables Fixter takes in every language.11 The fifth names the environment, so production and staging stay apart in Fixter.11 ${{RAILWAY_SERVICE_NAME}} and ${{RAILWAY_ENVIRONMENT_NAME}} are Railway-provided variables, filled in by Railway; its own OpenTelemetry guide uses them inside these values the same way.7 On Python, add a sixth variable, OTEL_LOGS_EXPORTER=otlp, so your logs export alongside the traces.11 Railway can seal a variable so its value is never shown in the UI or returned by the API again, which suits the one that carries your key. Sealing cannot be undone.8
- Start the app with OpenTelemetry loaded. Set the start command in the service's Settings, in
railway.json, or in aProcfile.7
- Deploy, then check. Variable changes on Railway are staged until you review and deploy them.8 After the deploy, send a request to your app and open the Logs page in Fixter filtered on your service name, or ask your coding agent once it is connected to Fixter over MCP.11
One thing Railway's guide warns about: OpenTelemetry SDKs do not flush on shutdown by themselves. If your code starts the SDK itself, call its shutdown() from a SIGTERM handler, or the last batch before a redeploy is lost.7
Railway's own tracing and these variables
Railway has a tracing preview. Switched on with the Traced switch or railway trace enable, it sets OTEL_EXPORTER_OTLP_ENDPOINT, the protocol, a header, the service name and version on the next deploy, pointing at a Railway receiver that accepts traces only.6 A variable you set yourself takes precedence: once you set your own endpoint, Railway adds none of its tracing variables and your app's spans no longer reach Railway's Traces page. Railway's edge still traces requests to the service.6 So pick one destination for your app's own spans, and send logs to the one that takes logs.
What your logs turn into
Keeping logs longer is the smaller half. The bigger half is not having to read them to find out something broke. Fixter (fixter.dev) finds and fixes the issues in your app in production, from your coding agent: errors, failing infrastructure, slow requests and downtime. It finds the root cause and fixes it: in your agent over MCP, or as a pull request ready for your review. Nothing to learn, built for small teams.
With your Railway service sending over OpenTelemetry, this is what you get:
- Errors as issues, not lines. The same exception thrown a thousand times is one issue with a count, and errors that differ only by an id stay together. Each issue says where in your code to look and when it started.12
- Alerts on what your app says. You hear about new issues, error bursts and anomalies without setting anything up, and you can add your own rules on top, including one built straight from a log search.13
- By email or Slack, with what broke and why, not just that a number crossed a line.13
- Your coding agent sees production. Ask Claude Code or Cursor what broke in the API service last night, and fix it from there or review a pull request.
- Staging and production kept apart, from the environment name Railway fills in.12
Railway keeps doing what it is good at: deploys and resource metrics. For the agent side, see how to debug production with Claude Code, and for the wider question of what a small team should log, log analysis for small teams.
Key takeaways
- Railway keeps logs 3 days on Free, 7 on Trial and Hobby, 30 on Pro, up to 90 on Enterprise
- Search is good inside that window; there are no alerts on log content and no log drain
- Railway monitors alert on CPU, RAM, disk and egress only, on Pro
- Logs leave from inside the app: OpenTelemetry plus five service variables (six for Python logs)
- Your own OTLP endpoint switches off Railway's tracing variables
- Or paste "Read fixter.dev/llms.txt and set up Fixter." into your coding agent
Frequently asked questions
How long does Railway keep logs?
According to Railway's docs: 3 days on the Free plan, 7 days on the Trial and Hobby plans, 30 days on Pro, and up to 90 days on Enterprise. Upgrading restores logs that had fallen outside the old retention period. Traces from Railway's tracing preview are kept for the same period as logs.
Can Railway alert me when my logs show an error?
Not on log content. Railway's monitors alert on CPU, RAM, disk usage and network egress, need the Pro plan, and notify by email, in the app or through a webhook. Webhooks also fire on deployment status changes and volume usage. To get alerted on an error in your logs, send the logs to a tool that alerts on them.
Does Railway have log drains?
No. Railway's docs say it has no setting to forward a service's stdout to an external URL. The options it gives are an OpenTelemetry or vendor SDK in your app, or a forwarder such as Vector or Fluent Bit running as its own Railway service.
How do I search Railway logs?
In the Log Explorer, or with railway logs in the CLI. The filter syntax takes plain text or quoted phrases, @attribute:value for fields in structured JSON logs, AND, OR and - for negation, and numeric comparisons such as @httpStatus:>=400 on HTTP logs. In the CLI, --filter takes the same syntax and --since and --until set a time range.
How do I send Railway logs to another tool?
Add OpenTelemetry to the app and set the OTLP variables as Railway service variables: a service name, the backend's endpoint, the protocol and an authorization header. Logs need a logging library that OpenTelemetry bridges, such as Pino or Winston in Node or the standard logging module in Python, where OTEL_LOGS_EXPORTER=otlp also has to be set. Railway's variables can fill in the service and environment names for you.
Does Railway's own tracing work alongside this?
Railway's tracing is a preview that accepts traces only. When you set your own OTEL_EXPORTER_OTLP_ENDPOINT, Railway adds none of its tracing variables and your app's spans no longer reach Railway's Traces page; its edge still traces requests to the service.
Can my coding agent set this up?
Yes. Paste "Read fixter.dev/llms.txt and set up Fixter." into Claude Code, Cursor or another coding agent in your project. It adds standard OpenTelemetry to the app; you then add the variables it names to your Railway service.
Sources (14), all checked November 20, 2026
- Railway docs, Logs (retention by plan, filter syntax, structured logs, 500 lines per second per replica, no log drain setting)
- Railway, Pricing (plans and prices, log retention per plan)
- Railway docs, project dashboard and monitors (monitors on CPU, RAM, disk and network egress, Pro plan, email, in-app and webhook notifications)
- Railway docs, Webhooks (deployment status changes, volume usage alerts, CPU and RAM monitor alerts)
- Railway docs, Metrics (CPU, memory, disk, network, up to 30 days)
- Railway docs, Tracing (preview, the Traced switch, the variables it sets, your own endpoint takes precedence, traces only)
- Railway guide, sending data to a third-party tool (OTLP variables, Railway system variables, where to set the start command, forwarders, flushing on shutdown)
- Railway docs, Variables (adding variables, staged changes, sealed variables, reference syntax)
- Railway docs, railway logs (--filter, --since, --until, --lines, --json)
- Railway docs, Railway MCP server (railway mcp install, the local server get_logs tool)
- Fixter docs, Send data with OpenTelemetry (API key, four environment variables, logs per language, environment name)
- Fixter docs, Issues (grouping, what an issue carries, environments)
- Fixter docs, Alerts (rules on logs, spans or metrics, automatic alerts, Alert on this from the Logs page)
- Fixter, llms.txt (what the setup prompt tells your agent to do)