CFObjective Notes: Errors Are Best When Emailed Said Nobody Ever - Adam Tuttle

May 17, 2013

Errors Are Best When Emailed Said Nobody Ever - Adam Tuttle

Not unreasonable to get 100 errors/day, depending on the app you support
that's 12 errors/hour
1 every 5 minutes
have to interrupt what you're doing to go look at them.
stopping what you're doing every 5 minutes, ruins your flow.
a 5 minute interruption probably takes you a half hour to recover form, productivity wise
So is there an app for that? Yes, error logging and analytics.
usually error emails work like this
1. everyone gets the email but nobody looks at it
or
2. shared team email account that interrupts EVERYone
-- dedicated inbox manager; rotating if you're lucky.
when data is in an email, you can't get data out.
how many errors have you gotten in the last 30 days? this week? today?
has the frequency of any error gone up recently?

best thing your an do with emails is use in-bound routing rules to push stuff into specific folders

alerts out of error logging platforms
new, unique errors
frequency exceeds a threshold (more than X errors/hour)
error severity code
heartbeat failure
-- have your app "check in" and say "yes i'm still running". can be notified if that fails.

Some options

Cloud services:
Errplane.com
Raygun.io
Airbrake.io
loggly.com

self hosted:
BugLogHQ- Oscar Arevalo
Hoth - Aaron Greenlee
Honorable Mention: Iron Gate
All 3(?) are open source

Application.cfc
on error()
{
thing.log()
}

Hoth --
logs to text files
built specifically and only for CF exceptions (so can't log JS errors, etc)
included report UI targets Coldbox
Only local machine -- has to run ON the server w/ your CF app
-- so if you have a 5- server cluster, all 5 need their own copy of Hoth running
Star Wars Reference

BugLogHQ
logs to a database
supports 1 custom field, flexibility for non CFML errors
reports via UI with pretty graphs and filtering
REST API for remote access
RSS log available
Built-in fallback to email.

BugLogHQ has more customizable alerts
discard
firstMessage Alert
frequencyAlert
more

Hoth always emails you when a previously unknown exception occurs

BugLogHQ -
to make it run fast, when you submit a bug, it gets stuck in a queue
then later, a scheduled task runs to process it
can "force processing" of errors in the queue.
database structure doesn't need its own DB
-- probably a dozen or fewer tables
-- can set your own prefix for table names

Let's look at data
RSS feed to access it
Custom bot that monitors RSS feed for new entries and sends me an IM when anything is added
-runs on Node.js
-Heroku free tier
-OSCAR, redis, freeparser libs
- that plus 100 lines of javascript, gets me a mashup of all the data that matches my criteria, and i get sent an IM

Notifications are only limited by your imagination, can be contacted by any way you can think of.

Also look at IronGate Exception Management Application.