public
Description: A stand-alone Merb eXception tracker inspired by logged_exception
Clone URL: git://github.com/fightinjoe/mex.git
Search Repo:
Aaron Wheeler (author)
Thu Apr 17 05:56:03 -0700 2008
mex /
name age message
folder .gitignore Sun Mar 30 23:06:30 -0700 2008 Initial checkin [Aaron Wheeler]
folder README Thu Apr 17 05:56:03 -0700 2008 Updated README [Aaron Wheeler]
folder application.rb Thu Apr 17 05:49:05 -0700 2008 Renamed from Axe to MeX [Aaron Wheeler]
folder config/ Thu Apr 17 05:49:05 -0700 2008 Renamed from Axe to MeX [Aaron Wheeler]
folder datamapper_ext.rb Sun Mar 30 23:49:23 -0700 2008 Updated to view index page and support api requ... [Aaron Wheeler]
folder public/ Thu Apr 17 05:49:05 -0700 2008 Renamed from Axe to MeX [Aaron Wheeler]
folder views/ Thu Apr 17 05:49:05 -0700 2008 Renamed from Axe to MeX [Aaron Wheeler]
README
MeX - Merb eXception tracking
==============

Version 0.1.0

==============

MeX is a flat Merb app that provides a web service for logging exceptions
raised by other web apps.

Start from the command line with:

  merb -p 4911

From within a Merb app, you can then log exceptions from the exceptions.rb
controller of any local Merb app like this:

class Exceptions < Application
    def internal_server_error
      exception   = self.params[:exception]
      request     = self.request
      orig_params = self.params[:original_params]

      params = {}
      params['mex[project_name]']    = orig_params[:pn] || 'Kurabelu'
      params['mex[exception_class]'] = exception.name
      params['mex[controller_name]'] = orig_params[:controller]
      params['mex[action_name]']     = orig_params[:action]
      params['mex[message]']         = exception.message
      params['mex[backtrace]']       = exception.backtrace.to_yaml
      params['mex[params]']          = orig_params.to_yaml
      params['mex[environment]']     = request.env.merge( 'process' => $$ ).to_yaml
      params['mex[url]']             = "#{request.protocol}#{request.env["HTTP_HOST"]}#{request.uri}"

      Net::HTTP.post_form( URI.parse('http://localhost:4911/mexes'), params ).body
    end
end

You can then view the exceptions here:

http://localhost:4911

MeX is heavily inspired by exception_logger - http://github.com/defunkt/exception_logger