10 hours ago
Hi folks! Is there an easy way to export logs from a service? I want to run analysis and need logs from at least 7 days, but preferably from last 30 days.
0 Threads mention this feature
3 Replies
10 hours ago
The CLI's railway logs command can pull historical logs for a service and write them to a file, for example railway logs --service <name> --since 1w --json > logs.ndjson. Passing --since switches it from streaming to fetching past logs, and --json outputs newline-delimited JSON that is easy to analyze. --since and --until take relative times like 1d or 1w or ISO 8601 timestamps, so you can fetch a range in chunks. Add --http or --build to export HTTP or build logs instead.
Your workspace is on Pro, which gives you access to the last 30 days of logs. The full list of flags is in the railway logs docs.
Status changed to Awaiting User Response Railway • about 10 hours ago
9 hours ago
While I can use CLI, what I would prefer is that this "download" button in UI get me all logs for selected range (which is last month in this case), and not only the ones I can see right now in my screen. My expectation was that It would download logs from past month, but it got me only for last 8 hours or something like that.
I guess this thread can be converted to #suggestion rather than ask for support now.
Attachments
Status changed to Awaiting Railway Response Railway • about 9 hours ago
9 hours ago
Thanks, we've noted this as feedback: you'd like the dashboard download to export every log in the selected range, not just the logs currently loaded on screen. Your Pro plan keeps 30 days of logs, so the full month you selected is still retained.
Status changed to Awaiting User Response Railway • about 9 hours ago
