Reputation: 34523
Other posts on SO explain how to show stack traces in views while in production, but what if we want the errors to appear in the server logs? What is the right way to accomplish this?
We're using Rails 3.2.12.
Upvotes: 0
Views: 3661
Reputation: 9495
Log levels, which is mentioned in the guides.
The default Rails log level is
info
in production mode anddebug
in development and test mode.To change the default log level, use
config.log_level = :warn # In any environment initializer
So, apparently, you need to modify your production
environment initializer config to use :debug
log level.
However, this will cause logs to grow rapidly. If you encounter bugs, you should be solving them in development mode. In production it's common to tune the app just to fail silently with not-so-descriptive error message in case of an error. For hunting down environment-specific bugs, it's suggested to use a production
-like staging
enviromnent.
Upvotes: 1