Q:

Is ActiveRecord::Base.logger different then rails logger?

if I set ActiveRecord::Base.logger.level what its effect on config.log_level (Rails 5)?
I could not find documentation on ActiveRecord log levels - are all sql queries output to the same level? what is it?
Can I stop SQL queries log only from config.log_level?
Thanks a log ;-)

A:

By default ActiveRecord uses the same instance of logger as Rails (ActiveRecord::Base.logger.object_id == Rails.logger.object_id # => true). This means that changing log level on AR is going to change config.log_level.
What you can do is you can set another logger instance for AR like this: 
ActiveRecord::Base.logger = ActiveSupport::Logger.new(STDOUT)
ActiveRecord::Base.logger.level = :warn

(place it into e.g. config/application.rb)
This way it won't affect config.log_level

