Feature #4393
closedMake Logger rotate and split logfiles
0%
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)
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?
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).
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.