Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Rails.logger should have level specified by config.log_level. #11665

Merged
merged 2 commits into from Aug 4, 2013

Conversation

Projects
None yet
3 participants
Contributor

mshytikov commented Jul 30, 2013

Fix bug when log level of Rails.logger (which was set via config.logger) does not match the config.log_level.

Example:

# in config/application.rb
 config.logger = Logger.new(STDOUT)

# in config/environments/development.rb
 config.log_level = :info

Start rails console for example

$ rails c
> Rails.logger.level
=> 0
> ActiveSupport::Logger::INFO == Rails.logger.level
=> false 

mshytikov added some commits Jul 30, 2013

@mshytikov mshytikov Rails.logger should have level specified by config.log_level.
Fix bug when log level of Rails.logger (which was set via config.logger) does not match the    config.log_level.
e2180e8
@mshytikov mshytikov fix tests af1e3b7
Contributor

sorentwo commented Aug 2, 2013

Not having the log_level applied with a custom logger can be confusing. I imagine Heroku users get bitten by this rather often. 👍

@rafaelfranca rafaelfranca added a commit that referenced this pull request Aug 4, 2013

@rafaelfranca rafaelfranca Merge pull request #11665 from mshytikov/fix-config-log_level
Rails.logger should have level specified by config.log_level.
0673938

@rafaelfranca rafaelfranca merged commit 0673938 into rails:master Aug 4, 2013

1 check passed

default The Travis CI build passed
Details

@rafaelfranca rafaelfranca added a commit that referenced this pull request Aug 4, 2013

@rafaelfranca rafaelfranca Add CHANGELOG entry for #11665
[ci skip]
3a7e321

@rafaelfranca rafaelfranca added a commit that referenced this pull request Aug 4, 2013

@rafaelfranca rafaelfranca Merge pull request #11665 from mshytikov/fix-config-log_level
Rails.logger should have level specified by config.log_level.
Conflicts:
	activemodel/test/cases/railtie_test.rb
5deedc6

@mshytikov mshytikov deleted the unknown repository branch Sep 30, 2013

@senny senny added a commit that referenced this pull request Jan 13, 2014

@senny senny Only lookup `config.log_level` for stdlib `::Logger`. Closes #11665.
This prevents Rails from assigning meaningless log levels to third
party loggers like log4r. If `Rails.logger` is not `kind_of?(::Logger)`
we simply assign the `config.log_level` as is.

This bug was introduced by #11665.
e0a521c

@senny senny added a commit that referenced this pull request Jan 13, 2014

@senny senny Only lookup `config.log_level` for stdlib `::Logger`. Closes #11665.
This prevents Rails from assigning meaningless log levels to third
party loggers like log4r. If `Rails.logger` is not `kind_of?(::Logger)`
we simply assign the `config.log_level` as is.

This bug was introduced by #11665.

Conflicts:
	railties/CHANGELOG.md
	railties/test/application/configuration_test.rb
e2b2539

@tenderlove tenderlove added a commit that referenced this pull request Jan 17, 2014

@tenderlove tenderlove Merge branch 'master' into set_binds
* master: (24 commits)
  unscope should remove bind values associated with the where
  reverse_order_value= is not private, so no need to send
  avoid more dynamic symbols
  no need to to_sym
  recover from test runs that leave the database in a bad state
  updates screenshot data [ci skip]
  "serie" => "series"
  revises a few things in the getting started guide [ci skip]
  Favor canonical environment variables for secrets
  removed extra comma [ci skip]
  Only lookup `config.log_level` for stdlib `::Logger`. Closes #11665.
  Updated Changelog to reflect removal of :dependent => :restrict
  standardize on jruby_skip & rbx_skip
  fix bug in becomes! when changing from base to subclass. Closes #13272.
  highlight http://localhost:3000 in README.md. Closes #13643. [ci skip]
  doc proc/lambda arg on inclusion validation. Closes #13689. [ci skip]
  Skip Spring App Generator tests on JRuby
  fixes a typo in a CHANGELOG
  upgrade SDoc
  fixes the Gemfile generator templates
  ...

Conflicts:
	activerecord/test/cases/hot_compatibility_test.rb
bf48af5

@guilleiguaran guilleiguaran added a commit that referenced this pull request Feb 21, 2014

@guilleiguaran guilleiguaran Revert "Only lookup `config.log_level` for stdlib `::Logger`. Closes #…
…11665."

This reverts commit e0a521c.

Conflicts:
	railties/CHANGELOG.md

We expect loggers to quack like stdlib logger. If log4r needs different
level= assignment, using a Logger-quacking wrapper is the way to do it.

Fixes #14114.
d094d7e

@guilleiguaran guilleiguaran added a commit that referenced this pull request Feb 21, 2014

@guilleiguaran guilleiguaran Revert "Only lookup `config.log_level` for stdlib `::Logger`. Closes #…
…11665."

This reverts commit e0a521c.

Conflicts:
	railties/CHANGELOG.md

We expect loggers to quack like stdlib logger. If log4r needs different
level= assignment, using a Logger-quacking wrapper is the way to do it.

Fixes #14114.
b1867c8

@guilleiguaran guilleiguaran added a commit that referenced this pull request Feb 21, 2014

@guilleiguaran guilleiguaran Revert "Only lookup `config.log_level` for stdlib `::Logger`. Closes #…
…11665."

This reverts commit e2b2539.

Conflicts:
	railties/CHANGELOG.md

We expect loggers to quack like stdlib logger. If log4r needs different
level= assignment, using a Logger-quacking wrapper is the way to do it.

Fixes #14114.
20f475c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment