public
Description: dumb rails log file parser
Clone URL: git://github.com/jnunemaker/railsfile.git
Search Repo:
name age message
folder README Wed Apr 02 21:03:18 -0700 2008 added railsfile code [jnunemaker]
folder railsfile.rb Wed Apr 02 21:05:32 -0700 2008 removed extra method that i forgot to take out [jnunemaker]
README
A really quick and simple rails log file parser. I'm going to use it someday to throw log stuff in database and make a 
simple rails app to do reporting on slowest urls, etc.

  logfile = Railsfile::Parser.new("#{ENV['HOME']}/Desktop/02_production.log")
  requests = logfile.requests
  [requests[0], requests[100]].each do |r|
    %w[request processing controller action ip_address occurred_at request_method 
      completion_time requests_per_second rendering_time db_time status_code url].each do |m|
      puts r.send(m)
    end
    puts ''
  end
  
Someday will be something like: 
  http://railscasts.com/episodes/97
  http://ckhsponge.wordpress.com/2006/10/11/ruby-on-rails-log-analyzer-rawk/
  http://rails-analyzer.rubyforge.org/
  http://nubyonrails.com/articles/a-hodel-3000-compliant-logger-for-the-rest-of-us