Docs

Logging

Logs for services deployed to Railway are available to diagnose issues or track performance.

How it Works

Any build or deployment logs emitted to standard output or standard error ( eg. console.log(...)) are captured by Railway to be viewed or searched later.

Log Retention

Depending on your plan, logs are retained for a certain amount of time.

PlanRetention*
Hobby / Trial7 days
Pro30 days
EnterpriseUp to 90 days

* Upgrading plans will immediately restore logs that were previously outside of the retention period.

Logging throughput

To maintain quality of service for all users, Railway enforces a logging rate limit of 500 log lines per second per replica across all plans. When this limit is exceeded, additional logs are dropped and you'll see a warning message like this:

Railway rate limit of 500 logs/sec reached for replica, update your application to reduce the logging rate. Messages dropped: 50

If you encounter this limit, here are some strategies to reduce your logging volume:

  • Reduce log verbosity in production
  • Use structured logging with minimal formatting (e.g., minified JSON instead of pretty-printed objects)
  • Implement log sampling for high-frequency events
  • Conditionally disable verbose logging based on the environment
  • Combine multiple related log entries into single messages

Viewing Logs

For information on how to view logs, head over to the guide for using logs.

Edit this file on GitHub