Mongrel clusters lets yuo pick a path to your logs with the "-l "
switch. I tried giving a pathc that contains the rotatelogs like

-l
|/usr/sbin/rotatelogs /var/log/mongrel.log 3600"

And it just gave me error. So I rolledup my sleeves and dig into:

1)
/usr/lib/ruby/gems/1.8/gems/mongrel_cluster-1.0.5/lib/mongrel_cluster/init.rb

2) /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.4/lib/mongrel/configurator.rb

I tried to re-built the log file name so on "1)" if passes and ARGV
like:

       ##exec_cmd +=" -l  #{port_log_file(port)}"
       exec_cmd +=" -l |/home/admin/rotatelogs #{port_log_file(port)}
30"

but I get this:
starting port 3001
mongrel_rails start -d -e production -p 3001 -P log/silvex.3001.pid -l
|/home/admin/rotatelogs /var/log/my_mongrel3300.3001.log 30
ERROR RUNNING 'mongrel::start': missing argument: -l
Use help command to get help

Silvex ...
starting port 3002
mongrel_rails start -d -e production -p 3002 -P log/silvex.3002.pid -l
|/home/admin/rotatelogs /var/log/my_mongrel3300.3002.log 30
ERROR RUNNING 'mongrel::start': missing argument: -l
Use help command to get help

I tried a similar stunt on "2)" with

      logfile = ops[:log_file]
        ##if logfile[0].chr != "/"
         #logfile = File.join(ops[:cwd],logfile)
         #if not File.exist?(File.dirname(logfile))
         #   log "!!! Log file directory not found at full path
#{File.dirname(logfile)}.  Update your configuration to use a full
path."
         #   exit 1
         # end
        #end

        lati_logfile = "|/home/admin/rotatelogs " + logfile + " 15"
        rotate_log = File.popen(lati_logfile,"w")

        #Daemonize.daemonize(logfile)
        Daemonize.daemonize(rotate_log)

Is this EVEN feasiable ?
-- 
Posted via http://www.ruby-forum.com/.
_______________________________________________
Mongrel-users mailing list
Mongrel-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/mongrel-users

Reply via email to