Project

General

Profile

Actions

Defect #19405

closed

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

Added by Scott Macpherson over 9 years ago. Updated over 9 years ago.

Status:
Closed
Priority:
Normal
Category:
Rails support
Target version:
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:
Fixed
Affected version:

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
Actions #1

Updated by Jean-Philippe Lang over 9 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.

Actions #2

Updated by Jean-Philippe Lang over 9 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.

Actions #3

Updated by Jean-Philippe Lang over 9 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF