CheapToad is a simple server plugin for the Hoptoad notifier. Make an app receive and store errors from any app in just a couple of lines!
Hoptoad (hoptoadapp.com) is a commercial application and hosting service, run by thoughtbot. For larger or more important apps, you'll want your error logging handled by a reliable, professional service, such as thoughtbot and Hoptoad. For small, simple and experimental apps, why pay money?
With CheapToad and Heroku, you can get mostly-reliable remote error logging for nothing. When and if your app grows larger, you can change two lines in config/initializers/hoptoad.rb and switch to Hoptoad.
Hoptoad has a far better interface, and is free for the first project and first two users (up to a given rate of errors received). But CheapToad could still be the right choice if you:
By the way, I'm not affiliated with thoughtbot. This is all reverse engineered from the Hoptoad notifier and somebody's RedMine plugin for Hoptoad. Thoughtbot is aware of CheapToad's existence, but I'm not an employee or anything.
Also, if you like CheapToad for your experimental projects, consider upgrading a project or two to Hoptoad, or getting your employer to do the same. I don't get a cut, but if I/we are costing them money overall then they have less incentive to keep giving us code to use. If we act like the farm team for their stuff and occasionally upgrade, they have more incentive to keep writing things like the hoptoad_notifier for us to bend to our own purposes.
Make a new Rails app, or choose an existing one. In config/environment.rb, add the line 'config.gem "cheaptoad"'. You'll also need to go into config/routes.rb and add the line "resources :notices". Now that app can receive Hoptoad errors!
In any and all apps that you want to send errors to your app, create a file called config/initializers/hoptoad.rb, as you always would when using Hoptoad. Install the Hoptoad notifier also, of course. The config file will look a bit like this:
HoptoadNotifier.configure do |config| config.api_key = 'My Project Name' config.host = 'my-cheaptoad-catcher.heroku.com' config.port = 80 # or whatever port number # All standard Hoptoad filters are supported config.environment_filters << "MY_SECRET_KEY" end
Note that the host and port are for the app that will *receive* Hoptoad errors. That's the app you added the line config.gem "cheaptoad" to.
You'll need a Rails app, which will be your CheapToad server. It can do whatever else you like, but its notices controller will be used for CheapToad stuff.
You will not need a Hoptoad API key. That's kind of the point of this project. Instead of using a big hexadecimal string as your API key, I recommend you use a simple string like "My Blog" or "Secret Project X". That API key will be used by CheapToad as your project name.
By default, CheapToad has a built-in set of HTML and RSS files to give a very simple list of your errors. If you'd rather use your own, it's probably easiest to just build your own notices_controller.rb file and appropriate view files to go with it. You can look at the ones in the CheapToad gem to do it -- they're very simple. Then, add your own new HTML, CSS and whatnot to pretty it up.
We're considering adding the ability to put in your own CSS file without changing the HTML, just to make the output less stark. If you care about this feature and would use it, contact me and let me know!
sudo gem install cheaptoad
CheapToad is released under the MIT license. That means you need to acknowledge me, but otherwise you're free to do what you like. Use it in good health.