6

The default for production.rb is:

config.log_level = :info

However, I really like to see the SQL queries and extra logging in my production environment.

Changing the log level to:

config.log_level = :debug

Is this a terribly bad practice? How much overhead does this add to my application to have Rails do this extra logging?

dylanjha
  • 2,303
  • 4
  • 28
  • 47

2 Answers2

5

It's simply a question of how large a log file you're willing to deal with. I suggest setting it to :debug for a few days, and then decide based on the resulting log sizes. This is a decision that may change day-to-day, based also on what you need debugged, and how many and how verbose your debug statements are.

Mori
  • 27,279
  • 10
  • 68
  • 73
1

For your reference below are some links for rails best practices that I found while Googling:

Best Practices for a Web App Staging Server (on a budget)

http://kpumuk.info/ruby-on-rails/flexible-application-configuration-in-ruby-on-rails/

http://railsware.com/blog/2013/10/16/rails-configuration-in-the-proper-way/

Best practices for Ruby on Rails *feature* deployment?

Here is rails 4 production logging and new features:

http://rubyjunky.com/cleaning-up-rails-4-production-logging.html

Also in other way you can do it with easily by taking back up of production DB on your local machine and test / debug those data in the way that you want.

Community
  • 1
  • 1
Sumit Munot
  • 3,748
  • 1
  • 32
  • 51