This repository is private.
All pages are served over SSL and all pushing and pulling is done over SSH.
No one may fork, clone, or view it unless they are added as a member.
Every repository with this icon (
) is private.
Every repository with this icon (
This repository is public.
Anyone may fork, clone, or view it.
Every repository with this icon (
) is public.
Every repository with this icon (
| name | age | message | |
|---|---|---|---|
| |
README | Tue May 06 02:08:31 -0700 2008 | [lawrencepit] |
| |
Rakefile | Fri Jun 23 21:43:30 -0700 2006 | [technoweenie] |
| |
assets/ | Sun Sep 03 20:57:56 -0700 2006 | [technoweenie] |
| |
generators/ | Wed Feb 21 08:14:40 -0800 2007 | [technoweenie] |
| |
init.rb | Tue May 06 02:08:31 -0700 2008 | [lawrencepit] |
| |
install.rb | Sun Jul 02 06:55:40 -0700 2006 | [technoweenie] |
| |
lib/ | Tue May 06 02:08:31 -0700 2008 | [lawrencepit] |
| |
tasks/ | Fri Jun 23 21:43:30 -0700 2006 | [technoweenie] |
| |
test/ | Fri Jun 23 21:43:30 -0700 2006 | [technoweenie] |
| |
uninstall.rb | Fri Jun 23 21:43:30 -0700 2006 | [technoweenie] |
| |
views/ | Sun May 04 22:28:15 -0700 2008 | [ryanb] |
README
ExceptionLogger
===============
The Exception Logger (forgive the horrible name) logs your Rails exceptions in the database and provides a funky web
interface to manage them.
First you need to generate the migration:
./script/generate exception_migration
Next, you'll need to include the ExceptionLoggable module into ApplicationController. Once that's done you might want
to modify key methods to customize the logging:
render_404(exception) - Shows the 404 template.
render_500(exception) - Shows the 500 template.
log_exception(exception) - Logs the actual exception in the database.
rescue_action_in_public(exception) - Does not log these exceptions: ActiveRecord::RecordNotFound,
ActionController::UnknownController, ActionController::UnknownAction
Now add a new route to your routes.rb:
map.connect "logged_exceptions/:action/:id", :controller => "logged_exceptions"
After that, visit /logged_exceptions in your application to manage the exceptions.
It's understandable that you may want to require authentication. You can do this by creating your own controller
extending your ApplicationController (thereby leveraging all the existing authorization rules you may have) and include
the ExceptionLoggableControllerMixin module. For example:
class LoggedExceptionsController < ApplicationController
include ExceptionLoggableControllerMixin
self.application_name = "My Application Name" # this will show up in the title of the Rss feed
# add your regular permission checking here, e.g.:
protected
# only allow admins
# this obviously depends on how your auth system works
def authorized?
current_user.is_a?(Admin)
end
# assume app's login required doesn't use http basic
def login_required_with_basic
respond_to do |accepts|
# alias_method_chain will alias the app's login_required to login_required_without_basic
accepts.html { login_required_without_basic }
# access_denied_with_basic_auth is defined in ExceptionLoggableControllerMixin
# get_auth_data returns back the user/password pair
accepts.rss do
access_denied_with_basic_auth unless self.current_user = User.authenticate(*get_auth_data)
end
end
end
alias_method_chain :login_required, :basic
end
The exact code of course depends on the specific needs of your application.
CREDITS
Jamis Buck - original exception_notification plugin
Rick Olson - model/controller code
Josh Goebel - design



