On Sat, 24 Sep 2005, Joe Van Dyk wrote:

> :-)  You might want to re-read my question.

oops.

> Every time I start the application, I want to create a new log file and
> rotate the old ones (say, keep the last 10).  I did see the options for
> rotating on size and by date.  But I didn't see an option for rolling the
> log for every new application launch.
>
> So, if I start the application 5 times, there should be five log files.

perhaps:


   jib:~/tmp > ruby -e' print ARGF.read ' a.rb
   require 'logger'

   force_roll = Logger::new 'log', 7, 0
   force_roll << ''
   force_roll.close

   logger = Logger::new 'log', 7

   logger.info{ Process::pid }


   jib:~/tmp > ruby -e' p Dir[ "log*" ] '
   []


   jib:~/tmp > ruby -e' 10.times{ load "a.rb" } '


   jib:~/tmp > ruby -e' p Dir[ "log*" ] '
   ["log", "log.0", "log.1", "log.2", "log.3", "log.4", "log.5"]

but kinda hackish...

hth.

-a
-- 
===============================================================================
| email :: ara [dot] t [dot] howard [at] noaa [dot] gov
| phone :: 303.497.6469
| Your life dwells amoung the causes of death
| Like a lamp standing in a strong breeze.  --Nagarjuna
===============================================================================