Search code examples
ruby-on-railsruby-on-rails-4webrickruby-on-rails-4.1

After upgrading from Rails 4.0.3 to 4.1, WEBrick no longer prints anything to server console


After upgrading rails from 4.0.3 to 4.1.9, I start WEBrick, load pages of my app successfully in the browser, but nothing displays in the terminal window. No SQL, no render reports, not even a 500 server error gets a mention.

It does load the usual notifications that webrick is running:

$ rails s
=> Booting WEBrick
=> Rails 4.1.9 application starting in local on http://0.0.0.0:3000
=> Run `rails server -h` for more startup options
=> Notice: server is listening on all interfaces (0.0.0.0). Consider using 127.0.0.1 (--binding option)
=> Ctrl-C to shutdown server
[2015-01-15 15:47:22] INFO  WEBrick 1.3.1
[2015-01-15 15:47:22] INFO  ruby 2.0.0 (2013-06-27) [x86_64-darwin12.3.0]
[2015-01-15 15:47:22] INFO  WEBrick::HTTPServer#start: pid=1122 port=3000

Nothing has been changed except the rails upgrade, done by defining a version number in my Gemfile and running bundle update rails. I've tried setting a config.log_level = :debug in my environment's config file but got no love. Any ideas?


Solution

  • I ended up just re-defining my logs

    # application.rb
    
    config.logger = ActiveSupport::Logger.new(STDOUT)
    file_logger = Logger.new(Rails.root.join("log/#{Rails.env}.log"))
    config.logger.extend(ActiveSupport::Logger.broadcast(file_logger))