What's the best way to manage error logging for exceptions?

Posted by Peter Boughton on Programmers See other posts from Programmers or by Peter Boughton
Published on 2010-11-19T18:49:16Z Indexed on 2011/01/02 18:58 UTC
Read the original article Hit count: 271

Introduction

If an error occurs on a website or system, it is of course useful to log it, and show the user a polite message with a reference code for the error.

And if you have lots of systems, you don't want this information dotted around - it is good to have a single centralised place for it.

At the simplest level, all that's needed is an incrementing id and a serialized dump of the error details. (And possibly the "centralised place" being an email inbox.)

At the other end of the spectrum is perhaps a fully normalised database that also allows you to press a button and see a graph of errors per day, or identifying what the most common type of error on system X is, whether server A has more database connection errors than server B, and so on.

What I'm referring to here is logging code-level errors/exceptions by a remote system - not "human-based" issue tracking, such as done with Jira,Trac,etc.


Questions

I'm looking for thoughts from developers who have used this type of system, specifically with regards to:

  • What are essential features you couldn't do without?
  • What are good to have features that really save you time?
  • What features might seem a good idea, but aren't actually that useful?

For example, I'd say a "show duplicates" function that identifies multiple occurrence of an error (without worrying about 'unimportant' details that might differ) is pretty essential.
A button to "create an issue in [Jira/etc] for this error" sounds like a good time-saver.

Just to re-iterate, what I'm after is practical experiences from people that have used such systems, preferably backed-up with why a feature is awesome/terrible.
(If you're going to theorise anyway, at the very least mark your answer as such.)

© Programmers or respective owner

Related posts about exceptions

Related posts about bug-tracking