Logs are very delayed

Hey! Logs from my discord bot are highly delayed on railway. They take upto 20-30 seconds to appear. Can this be fixed?
30 Replies
cordila
cordilaOP3y ago
Sometimes they dont even arrive until I restart, then it shows up above
Adam
Adam3y ago
Railway’s logs aren’t the best. i’ve found good results setting flush= True on my print statements in python. Not sure about other languages
JustJake
JustJake3y ago
This is more on Python than our logging platform :/ p99 of logs show up within a second on being sent to the ingesting engine. If you've got issues would love to hear em. Happy to dig in wherever needed too
Adam
Adam3y ago
Gotcha, thanks for the clarification
cordila
cordilaOP3y ago
I would disagree, I've used D.Os App platform with the same code and the logs used to be displayed instantly, granted I would have to refresh the page if I have been inactive for it to repopulate it but the the logs would be instantly shown.
JustJake
JustJake3y ago
What language/framework etc
cordila
cordilaOP3y ago
Python A discord bot on dpy
JustJake
JustJake3y ago
WellThereItIs
cordila
cordilaOP3y ago
Yeah but it's just a suprise because both heroku and d.o didn't have this issue
JustJake
JustJake3y ago
Do you have PYTHONUNBUFFERED=TRUE?
cordila
cordilaOP3y ago
What's that?
JustJake
JustJake3y ago
In variables? Default behavior is to buffer logs
cordila
cordilaOP3y ago
Env variables?
JustJake
JustJake3y ago
Yep
cordila
cordilaOP3y ago
No I don't, didn't know that was a thing!
JustJake
JustJake3y ago
DO and Heroku will sometimes push stuff into your envs for you depending on the language We’ve considered maybe doing something like that but don’t want to without letting people know
cordila
cordilaOP3y ago
I don't need to change my code right? Just add PYTHONUNBUFFERED=TRUE and redeploy?
JustJake
JustJake3y ago
Yup And if you add it, we’ll auto redeploy 🙂
cordila
cordilaOP3y ago
Yeah but I think a popup would definitely help most people, I wasn't aware this even existed haha I'll try this and let you know
JustJake
JustJake3y ago
Yep totally
cordila
cordilaOP3y ago
It will take me some time to verify if this helps but atleast after the redeploy they seem to be much faster! Also just wanted to let you guys know, when vars are changed, railway rebuilds and redeploys but the older deployment isnt removed which causes the application to connect 2 times.
cordila
cordilaOP3y ago
Not sure if its intended It has to be manually removed ^
JustJake
JustJake3y ago
It can take up to 30s sometimes to remove it
Adam
Adam3y ago
Takes about 30 seconds for the deployment to be removed usually
cordila
cordilaOP3y ago
Ah gotcha thank youu! Ill leave this open for 30 mins~ just to verify logs are working and then close it
JustJake
JustJake3y ago
You can set RAILWAY_DEPLOYMENT_OVERLAP_SECONDS=0 if you wanna change that
cordila
cordilaOP3y ago
Damn thats pretty cool, you got a list of these secret env vars? hehe
JustJake
JustJake3y ago
Hehehe, they should be in the docs I think
cordila
cordilaOP3y ago
I dont see it <:fh_sigh:859551197186490390> Oh I found a few
cordila
cordilaOP3y ago
That
Want results from more Discord servers?
Add your server