Home

Skip to Content Skip to Navigation

In my first few months at Forward, one of the coolest new features I encountered was the ability to track errors with a third-party service such as Airbrake or Exceptional.io, which are used by a number of our Ruby and Javascript based systems. Recently I’ve been working with a WordPress system that needs to scale to cope with high levels of traffic across multiple blogs, so I had a little investigation if there was a feasible.

Turns out Exceptional.io has a third-party PHP client that is incredibly simple to set up, even using WordPress: exceptional-php. Here are the steps I used to set it up:

  1. Sign for for a free 1-month trial on Exceptional.io, and retrieve your API key from the App Settings.
  2. Checkout the exceptional-php repo somewhere in your WordPress installation, I dropped in the root folder.
  3. Now we need to include and set up the library. To do this we are going to hook into the ‘init’ action with the code below. I placed this in my theme’s functions.php, but  feel free to place this anywhere whether the add_action function is available (in a plugin for example):
  4. That should be it!
I recommend you find a way to produce an error on you local or development setup, Exceptional will record the error regardless. Once Exceptional tracks the error, you should get an e-mail for each new error message, which you can follow up on the online interface which provides a trace and list of sources for the error.
Very useful for when your business critical system run on WordPress. Check out the docs for exceptional-php too there are some config options which you may find useful.
Any questions feel free to comment below.

NB: I have only tested this with WordPress 3.3+, but I imagine the PHP version matters more.

1 Response to Tracking WordPress Errors with Exceptional.io

Avatar

Ben Arent

August 2nd, 2012 at 1:08 am

Thanks for the post Luke. This makes me think that we should setup an official wordpress plugin.

Comment Form

Back to top