dougiebuckets
dougiebuckets

Reputation: 2453

"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?

Upvotes: 21

Views: 4997

Answers (1)

Thiago Diniz
Thiago Diniz

Reputation: 3121

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.

Upvotes: 38

Related Questions