How to disable logging in Rails application

It’s not a good practice to do though depends on your needs. It can be done by two ways, one is to disable for whole application and another is to disable for specific environments. You’re probably looking for some or all of the following settings:

config.logger
config.active_record.logger
config.action_controller.logger
config.action_view.logger
config.action_mailer.logger
config.active_resource.logger

If you set any of them to nil like following way:

config.active_record.logger = nil

It should disable logging for that specific component. You can experiment with these to disable logging for specific components or set all of them to nil to get no logging.

Leave a Comment