Reputation: 113
The examples I've seen for setting log level seems straightforward in most instances however how do I set the log level for my custom logger:
config.active_record.logger = Logger.new("log/custom_log_file.log")
According to the rails guides I should be able to make one of the following calls to set a log level to debug, but I believe this is a global thing.
config.log_level = :warn # In any environment initializer, or
Rails.logger.level = 2 # at any time
Upvotes: 1
Views: 237
Reputation: 24337
You can set the level right after adding the custom logger:
config.active_record.logger = Logger.new("log/custom_log_file.log")
config.active_record.logger.level = 2
Upvotes: 1