R
Railway11mo ago
faces

Logging in BetterStack, PaperTrail, or DataDog?

Hey good morning! My team is trying out Railway for a project today and was wondering how to export logs to somethiing a bit more full featured than what's offered here? The log feature in Railway looks promising, but we rely on monitors and alerts from external tooling that are based on log entries when things fail. With other hosting providers we can hook it up so BetterStack, PaperTrail, or DataDog captures the output of each service being piped to stdout / stderr. How do I do this with Railway? Thanks!
10 Replies
Percy
Percy11mo ago
Project ID: da3586ad-cd7b-4104-93e7-f2c2a0360858
faces
facesOP11mo ago
da3586ad-cd7b-4104-93e7-f2c2a0360858
Brody
Brody11mo ago
https://community.railway.app/feature-request/better-logging-support-1e6f5676 Railway doesnt support any kind of log drain like heroku does, there is no straight forward way to ship a services stdout / stderr to any logging provider at the moment. you would need to ship logs from within your code using the providers SDK
faces
facesOP11mo ago
Ahh man that's a bummer. Maybe this is something I can do via customized Docker builds?
faces
facesOP11mo ago
Something like this I guess? But then I'd miss out on my postgres / redis logs? https://betterstack.com/docs/logs/docker/
Brody
Brody11mo ago
ah yeah thats another option i didnt think of, run a second service inside the container that captures the main applications stdout / stderr and ships that to betterstack / wherever and you could do the exact same for the database services too, they are after all services all the same, you would just need to make a docker image that does the above but runs postgres / redis instead of your app
faces
facesOP11mo ago
Kind of defeats the purpose of having Railway run the managed instance for those. Appreciate the pointers, I left some comments on the feature request thread. It's a bummer that's been open for two years though. I'm assuming perhaps Railway wants to own that part of the stack too, which would be nice! Just need to build out some more functionality to ensure people don't need those external logging services. It's halfway there looks like now. I for one would appreciate not having to pay another log provider, so I can understand if that's the product direction.
Brody
Brody11mo ago
little correction, railway doesnt manage anything in the typical sense, the most railway does is restart the database / service if it crashes. but yes it is a bummer, even if railway does want to own that part of the stack they should still provide a way to ship logs elsewhere too
faces
facesOP11mo ago
Gotcha, "managed" in a sense like I don't have to tune the cpu / memory or configuration files.
Brody
Brody11mo ago
true true, but defaults for those things arent good either, though thats not really a railway issue (had a postgres database sitting around unused idling at 13gb of ram)
Want results from more Discord servers?
Add your server