Export all logs from a service (last 7 days/30 days)
yashko
PROOP

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.

Under Review

0 Threads mention this feature

3 Replies

Railway
BOT

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


yashko
PROOP

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.

image.png

Attachments


Status changed to Awaiting Railway Response Railway • about 9 hours ago


Railway
BOT

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


Welcome!

Sign in to your Railway account to join the conversation.

Loading...