config.logger level is overwritten

Hello all,

I have a comment about rails logger and I wish to change its behaviour.

Rails tries to load the logger from config like this:

Rails.logger ||= config.logger || begin
logger = ActiveSupport::Logger.new(config.default_log_file)

end

``

https://github.com/rails/rails/blob/fa986ae0cac423bf1ebcb5caeccbecf00c990094/railties/lib/rails/application/bootstrap.rb#L36

Then later after the above block, it sets the logger level:

Rails.logger.level = ActiveSupport::Logger.const_get(config.log_level.to_s.upcase)

``

https://github.com/rails/rails/blob/fa986ae0cac423bf1ebcb5caeccbecf00c990094/railties/lib/rails/application/bootstrap.rb#L53

The problem is that this overwrites the level that is set in the config.logger. In normal cases, it is no problem. But when different logging classes are embedded

and they depend on the log level, this makes a problem since the final value of the logger will be different from the value set in the config.logger.

Moreover, it is more intuitive to expect the logging level set on the object provided rather than config.log_level.