Defect #11603

log file rotation is broken: undefined method `log_path' for #<Rails::Application::Configuration:0xb60966d4>

Added by Niels Boeger almost 8 years ago. Updated over 7 years ago.

Status:ClosedStart date:
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:Documentation
Target version:-
Resolution:Fixed Affected version:2.0.3

Description

We enabled the log file rotation by changing config/additional_environment.rb like this:

#Logger.new(PATH,NUM_FILES_TO_ROTATE,FILE_SIZE)
config.logger = Logger.new(config.log_path, 7, 1000000)
config.logger.level = Logger::INFO

After a restart of Redmine, we get this error message: undefined method `log_path' for #<Rails::Application::Configuration:0xb60966d4>
Please see attached screenshot for details.

Enviroment:
  • Redmine (2.0-stable, rev. 10171)
  • Passenger/Phusion (latest) and nginx (1.2.2)
  • Ubuntu 10.04
  • MySQL

redmine_log_error.png - screenshot of the error message (63.7 KB) Niels Boeger, 2012-08-08 17:46

History

#1 Updated by Jean-Philippe Lang almost 8 years ago

  • Status changed from New to Closed
  • Resolution set to Invalid

Sorry, no technical support here. This is a Rails configuration issue.

#2 Updated by Jonas Pasche over 7 years ago

  • Status changed from Closed to Reopened

Maybe you're right, however the two lines of non-functioning code are directly copied from the official Redmine installation documentation - so even if it's not a Redmine error, it's at least a Redmine documentation error.

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

  • Category set to Documentation
  • Status changed from Reopened to Closed
  • Resolution changed from Invalid to Fixed

Documentation fixed. Rails' config.log_path is no longer available, you have to explicitly set the path to your logfile. Eg:

config.logger = Logger.new('/path/to/redmine/log/production.log', 7, 1000000)

Also available in: Atom PDF