a year ago
Hi! I want to import logs to file. How can I do it?
3 Replies
Status changed to Awaiting User Response Railway • over 1 year ago
a year ago
How can I do it? Can you send me docs?
Status changed to Awaiting Railway Response Railway • over 1 year ago
a year ago
Hey Oybek,
I dunno how familiar you are with bash scripting but you can get comfortable with: the > operator. It's called a redirection operator in the shell. When you use >, it redirects the standard output of a command into a file, overwriting the file if it already exists.
So with the CLI, you can do railway logs and then > to a file like output.txt
However, we would more than likely want to only take a subset of the logs as that will run for as long as railway logs is valid. So you can do something like: timeout 60 railway logs > output.txt which would give you all logs for the last 60 seconds assuming you have timeout on your machine.
(Make sure to railway link to the service you want the logs from.)
Let me know if this works. With that said, we only help with Railway related issues on this channel and this verges on personal programming skills- I believe in your ability to learn how to do more complex logging strategies.
- Angelo
Status changed to Awaiting User Response Railway • over 1 year ago
7 months ago
This thread has been marked as solved automatically due to a lack of recent activity. Please re-open this thread or create a new one if you require further assistance. Thank you!
Status changed to Solved Railway • 7 months ago