Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"puts" output not displaying in Heroku logs for Sinatra app

I'm trying to use "puts" to test a few things with a Sinatra app that's hosted on Heroku. Interestingly, the output seems to queue up and only displays upon restarting the Heroku dyno. I've tried with 'Thin' and 'Webrick', but have the same issue.

Any thoughts?

like image 854
dougiebuckets Avatar asked Mar 07 '14 22:03

dougiebuckets


1 Answers

As you can see on heroku docs: add this to your config.ru:

$stdout.sync = true

Don't forget the $ before stdout or it won't work.

like image 56
Thiago Diniz Avatar answered Nov 17 '22 22:11

Thiago Diniz