Defect #19405

Setting config.logger.level in additional_environment.rb has no effect

Added by Scott Macpherson over 3 years ago. Updated about 3 years ago.

Status:ClosedStart date:
Priority:NormalDue date:
Assignee:Jean-Philippe Lang% Done:

0%

Category:Rails support
Target version:3.0.2
Resolution:Fixed Affected version:3.0.1

Description

Since version 3.0.0 my production log files contain INFO messages and higher, despite setting a Logger level of ::WARN in additional_environment.rb.

Using the advice provided in RedmineInstall my config/additional_environment.rb contains the following two lines:

config.logger = Logger.new(Rails.root.join("log",Rails.env + ".log"),3,5*1024*1024)
config.logger.level = Logger::WARN

Environment:

Redmine version    3.0.1.stable
Ruby version       2.2.1-p85 (2015-02-26) [x86_64-linux]
Rails version      4.2.0
Environment        production
Database adapter   PostgreSQL

Associated revisions

Revision 14155
Added by Jean-Philippe Lang over 3 years ago

Fixed that setting config.logger.level in additional_environment.rb has no effect (#19405).

History

#1 Updated by Jean-Philippe Lang over 3 years ago

  • Category changed from Ruby support to Rails support
  • Status changed from New to Confirmed
  • Target version set to 3.0.2

Yes, this is due to r13899. The level set in environments/production.rb takes precedence over config/application.rb and thus additional_environment.rb. As a workaround, you can set it environments/production.rb.

#2 Updated by Jean-Philippe Lang over 3 years ago

  • Subject changed from config.logger.level in additional_environment.rb has no effect to Setting config.logger.level in additional_environment.rb has no effect
  • Status changed from Confirmed to Resolved
  • Assignee set to Jean-Philippe Lang
  • Resolution set to Fixed

Fixed in r14155.

#3 Updated by Jean-Philippe Lang about 3 years ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF