Question

I have 2 Ruby on Rails projects. When I start a rails server for the first project and login, I see this in the console:

Started POST "/users/sign_in" for 127.0.0.1 at 2013-11-15 10:40:24 +0100

When I start the rails server for the second project and login, I see this in the console:

Started POST "/users/sign_in" for 127.0.0.1 at 2013-11-15 10:39:46 +0100
Processing by SessionsController#create as HTML
  Parameters: {"utf8"=>"✓", "authenticity_token"=>"s8eI2YYtuduMy1Hxa7kJJUeCJoLi5pjEb7FmhpOE5/c=", "user"=>{"email"=>"test@test.nl", "password"=>"[FILTERED]"}, "commit"=>"Inloggen"}
  User Load (4.5ms)  SELECT "users".* FROM "users" WHERE "users"."email" = 'ed@salves.nl' LIMIT 1

I don't see any differences between the setup of both projects, but how can I make sure the first project also shows the exetended information?

Was it helpful?

Solution 2

I figured out it had to do with the recent switch to unicorn. Unicorn by default outputs the log to a file instead of STDOUT. So log\development.log is filled with all log messages, but not the terminal screen. To fix this, add this to config/development.rb:

  config.logger = Logger.new(STDOUT)
  config.logger.level = Logger.const_get(
    ENV['LOG_LEVEL'] ? ENV['LOG_LEVEL'].upcase : 'DEBUG'
  )

OTHER TIPS

Rails Logger verbosity can be defined with config.log_level in your config/environments files. You can set it to :debug, :info, :warn, :error, :fatal. Make sure your first project has the same settings of your second one.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top