merb_whoops_notifier
This is merb plugin for exception notification with Whoops. It should work with any merb app that’s based on merb 1.0 and higher
This plugin: github.com/flyingmachine/merb_whoops_notifier/tree/master The original: github.com/atmos/merb_hoptoad_notifier/tree/master
Usage:
1) Get Whoops (github.com/flyingmachine/whoops/tree/master) and set it up
2) Copy whoops.yml.example to the config directory of your merb app and modify it
3) Require this gem in dependencies.rb require ‘merb_whoops_notifier’
4) Add the following method to your Exceptions controller. Depending on your merb version you’ll need to use the exceptions,standard_error, or internal_server error as the action name. Kinda weak, but the API changed a lot in 0.9.x
class Exceptions < Merb::Controller
if %w( staging production ).include?(Merb.env)
def standard_error
WhoopsNotifier.notify_whoops(request, session)
render
end
end
end
5) Restart the server, trigger an error (in staging or prod) and check that it arrived at your Whoops server :)
Filtersing your post environment
# This feature hasn’t been tested If you have environmental variables set in your ruby process that should not be sent to whoops, there’s a mechanism for filtering those attributes now. Throw something like this in config/init.rb
Merb::BootLoader.after_app_loads do
WhoopsNotifier.environment_filters = %w(^AWS ^EC2 SECRET PRIVATE KEY)
end
Each of these words will be compiled into a regex so you should be able to use anchors if needed.
Thanks to atmos for the original merb_hoptoad_notifier plugin