Project

General

Profile

Actions

Feature #4393

closed

Make Logger rotate and split logfiles

Added by Felix Schäfer over 15 years ago. Updated over 14 years ago.

Status:
Closed
Priority:
Low
Assignee:
-
Category:
-
Target version:
-
Start date:
2009-12-14
Due date:
% Done:

0%

Estimated time:
Resolution:
Fixed

Description

This issue has already been discussed in #3388 (well, obviously more rejected than discussed), but I will repeat this feature request nonetheless, because Logger#new can do that on its own. This would require only a one-line addition to source:/trunk/config/environments/production.rb, for example:

config.logger = Logger.new(config.log_path, 7, 1048576)
Actions #1

Updated by Eric Davis over 15 years ago

How would this work in a multi process deployment where there are several processes writing to the log file at once?

Actions #2

Updated by Felix Schäfer over 15 years ago

Well, I just assumed that as Logger is part of stdlib it would take care of it, but I went digging in the ruby core_ext directory, and found logger.rb and monitor.rb. Short version: Logger uses a mutex through MonitorMixin. Long version: take a look at Logger#initialize (line 256) and LogDevice (line 473) in logger.rb and MonitorMixin (basically the whole file) in monitor.rb (lines apply for the OS X.6 version of 1.8.7, don't know how "vanilla" it is).

Actions #3

Updated by Felix Schäfer over 14 years ago

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

Some docs have been added in r4096 and on RedmineInstall.

Actions

Also available in: Atom PDF