Reputation: 5631
I am using logger to log the values of the variables for debuging. Because automatic debugging logs it is diffcult to find values
How to slient automatic logging?
Upvotes: 2
Views: 1965
Reputation: 2565
You can configure Rails logger in config/application.rb
. config.log_level
defines the verbosity of the Rails logger. The available log levels are: :debug, :info, :warn, :error, :fatal
.
Example:
config.log_level = :warn
Also read information about Logger: http://guides.rubyonrails.org/debugging_rails_applications.html#the-logger
Upvotes: 1
Reputation: 19475
You can't turn if off completely while still having your log messages go to the log, but there are a couple of solutions I can think of:
Set logging to a very high level (like :fatal
), then log your messages at that level. There shouldn't be much noise in the log at that log level.
Prefix your log messages with a unique identifier, e.g. MYSTUFF
, then grep for that when you're tailing the log: tail -f log/production.log | grep MYSTUFF
. Doing it this way means you don't have to change your log configuration.
Upvotes: 2