Raygun first experiences

So I had a spare half-hour this weekend, and thought I would take the time to finally plug in Mindscape's Raygun service to Enterprise Tester.





For this I decided to implement it as a plugin to Enterprise Tester, as it doesn't really make sense as a core feature for an application which is deployed both on-premise and hosted.

For Enterprise Tester, many of the exceptions within the application are not unhandled, but logged as ERROR level events in log4net with an associated exception object (especially on background threads), So for the plugin implementation I ended up:

  • Building a simple log4net appender that then logs to Raygun for ERROR and greater level events when an exception is present.
  • Building a simple listener for the app-specific "UnahandledException" event (this is where failures to start ET up, or fatal errors causing the shutdown of ET would crop-up, if the log4net configuration etc. has yet to be loaded).
  • Building a wrapper for the raygun message builder, that encapsulates adding some user custom data to the message being built - in this case containing details of the current user and their license entitlement (making it easy to identify the customer associated with the exception).

The whole process was incredibly simple, using the RaygunMessageBuilder class really simplifies the process of building up a suitable raygun message to fire at the service, and is a great starting point for creating a more application-specific message builder.

As I mentioned, this is built as a stand-alone plugin (not bundled with Enterprise Tester) - so if you want to get it, the source is available on the Enterprise Tester API examples project on github, and if you have any questions about it, please log them as issues on the github project.

Written on February 9, 2013