Skip to content

Commit

Permalink
Set IO.sync to true to flush STDOUT logging on Heroku
Browse files Browse the repository at this point in the history
  • Loading branch information
erkde committed Jan 21, 2016
1 parent 04dc2ee commit de99822
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions config/environments/production.rb
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@
config.logstasher.logger = Logger.new("#{Rails.root}/log/#{Rails.env}.json.log")
config.logstasher.suppress_app_logs = true
else
# flush output to the underlying OS without buffering
STDOUT.sync = true

# enable STDOUT logging for Heroku
config.logger = Logger.new(STDOUT)
config.logger.level = Logger.const_get(ENV['LOG_LEVEL'] ? ENV['LOG_LEVEL'].upcase : 'INFO')
Expand Down

0 comments on commit de99822

Please sign in to comment.