views:

66

answers:

3

For any serious software application, error logging and a feedback mechanism is simply indispensable. After you have captured the error log a log file ( maybe using something like log4net), or maybe during the time when an exception occurs, you want to prompt out a message box ( see below image), apologizing for the problem, and ask the user whether he would like to send the current state of the application along with all the relevant information to your email address. alt text

Now, this is easy to implement, but very tedious and I don't want to write a separate class for this for each of my projects, and neither do I want to reinvent the wheel. So I am looking for a open source library that does this well.

Any recommended component for exception notification library?

I am doing WinForms development, but the underlying concept should be the same.

A: 

Yes that is a pain, but there is hope. Using aspect oriented programming you can centralize your error logging, take a look at this article. I haven't used it but it seems promising.

stimms
A: 

I don't want to write a separate class for this for each of my projects

Why not just write one class in a class library to handle this and then reference it from your projects. It's what we did in our company, and it has served us very well.

In our scenario, we write everything to a database with the following structure:

 tblMonitoredSystems
  - SystemID
  - SystemName
  - SupportInfo

 tblEventSeverity
  - SeverityCode
  - SeverityDescription

 tblEvents
  - SystemID
  - EventDate
  - EventText
  - SeverityCode

Each app has it's own ID, which we specify when we begin development. We store it in the app.config or web.config. This allows our one system to be used for any application we write, with great consistency.

David Stratton
That would be a good idea, but utilizing an open source library is a better choice
Ngu Soon Hui
A: 

That dialog box is actually from Windows Error Reporting (WER). Dispite the word "Windows", you can also use this facility in your own applications, although I'm not sure what you have to do for it to work (organizationally and technically, that is). You might want to check out the link for more details.

Christian.K