In the heroku recipe we are adding the rails_stdout_logging gem. However, this is not necessary since Rails 5, as indicated in their README. The code shown there comes by default in the production.rb generated by rails generator, and apparently heroku automatically enables RAILS_LOG_TO_STDOUT.
The only difference is that by default in a rails generated app STDOUT.sync = false, and the rails_stdout_logging gem had it set to true. This means that Ruby would hold a buffer of logs before writing to standard input, instead of writing immediately. Don't know which we should include though.
This may help regarding the STDOUT.sync config. I think it is not that relevant, but I believe keeping the behaviour we had could be a good idea, as it has worked well so far.
In the heroku recipe we are adding the rails_stdout_logging gem. However, this is not necessary since Rails 5, as indicated in their README. The code shown there comes by default in the
production.rb
generated by rails generator, and apparently heroku automatically enablesRAILS_LOG_TO_STDOUT
.The only difference is that by default in a rails generated app
STDOUT.sync = false
, and therails_stdout_logging gem
had it set totrue
. This means that Ruby would hold a buffer of logs before writing to standard input, instead of writing immediately. Don't know which we should include though.