Guy Rosen wrote:
<snip>
> Note there is probably a bug when rotating by size
> (Logger#shift_log_age) in the same environment (haven't tested it, but
> reading the code seems to indicate it will happen). Although nothing
> will fail violently, each Rails process, ignorant of its peers, will
> rotate the logs and the end result will be multiple rotations!
There's definitely something screwy going on.  Try this code:

require 'logger'

logger = Logger.new('test.log', 100, 70 * 1024)

100.times do
   fork {
     1000.times do
       logger.info("This is a test line.")
     end
   }
end

I know, 100 is a ridiculous number.  It runs, though.  It should result 
in 100 full logfiles.  However, running this on my machine (Ubuntu 6.06, 
ruby 1.8.4) results in Logger::ShiftingErrors being thrown, and the 
logfile list when it's finished is incomplete (the last run only left 84 
logfiles, with apparently random gaps in the sequence), so there's been 
data loss - I presume from when the processes fell over having failed to 
log.

-- 
Alex