Article Options
Recently Viewed
Premium Sponsor
Premium Sponsor

 »  Home  »  .NET Framework  »  Exception Handling in Enterprise Applications  »  Suggestion 8, References and Links
 »  Home  »  .NET Newbie  »  Exception Handling in Enterprise Applications  »  Suggestion 8, References and Links
Exception Handling in Enterprise Applications
by Scott Rutherford | Published  02/28/2005 | .NET Framework .NET Newbie | Rating:
Scott Rutherford
Scott Rutherford is a consultant and .NET developer who has developed Enterprise business applications in many fields including Restaurant, Market Research, Automotive, and Analytical Chemistry. He is an Microsoft Certified Professional with the .NET Platform. 

View all articles by Scott Rutherford...
Suggestion 8, References and Links

8. Use enterprise tools to identify and respond to program errors

There are several tools available for monitoring your Event Log remotely, so keeping tabs on multiple servers is not a problem. One such program with which I've had success is Quest Software's Big Brother. A small windows service runs on each server and monitors a multitude of factors including Event Log messages. Reporting of errors can trigger an email or simply update a dashboard display on a single Big Brother server.

Of course you can monitor Event Logs manually across the network using MMC, or programmatically with WMI as well.

References

.NET Framework Developer's Guide: Best Practices for Handling Exceptions
http://msdn.microsoft.com/library/en-us/cpguide/html/cpconbestpracticesforhandlingexceptions.asp

Microsoft Knowledge Base Article - 315965
HOW TO: Use Structured Exception Handling in Visual Basic .NET
http://support.microsoft.com/default.aspx?scid=kb;en-us;Q315965&ID=kb;en-us;Q315965&SD=MSDN

.NET Framework Developer's Guide: Handling and Throwing Exceptions
http://msdn.microsoft.com/library/en-us/cpguide/html/cpconhandlingthrowingexceptions.asp

Choosing When to Use Structured and Unstructured Exception Handling
http://msdn.microsoft.com/library/en-us/vbcn7/html/vatskchoosingwhentousestructuredunstructuredexceptionhandling.asp

Development Impacts of Security Changes in Windows Server 2003
http://msdn.microsoft.com/library/en-us/dncode/html/secure06122003.asp (see Tighter ACLs on Event Logs)

Big Brother - http://www.bb4.org/

Monitoring in .NET Distributed Application Design
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnbda/html/monitordotnet.asp

How would you rate the quality of this article?
1 2 3 4 5
Poor Excellent
Tell us why you rated this way (optional):

Article Rating
The average rating is: No-one else has rated this article yet.

Article rating:3.7 out of 5
 10 people have rated this page
Article Score44234
Related Articles
Comments    Submit Comment

Comment #1  (Posted by an unknown user on 03/08/2005)
Rating
I have yet to put some time in practicing this and the content looks good for producing custom errors. I would like to see your ideas on how to deal with SQL/ODBC type errors in addition to these.
 
Comment #2  (Posted by (The Author) on 03/22/2005)
Rating
For ODBC errors, I catch these in the calling application and report as any other error described in the article. For SQL exceptions, I catch them inside the Stored Proc, and report a meaningful error back to the calling app.
 
Comment #3  (Posted by an unknown user on 08/24/2005)
Rating
Your article is basically focused on logging the event. You should take a look at log4net http://logging.apache.org/log4net/ as a tool it provides both logging level and application code context. It has a multitue of logging connectors (including Event Log.) that can be used simultaneously to log messages within your applications.
 
Comment #4  (Posted by Pawel Pabich on 08/25/2005)
Rating
Hajo,
I do not aggre that usage of enums is good practice.
You should rather create separate class for every type of error.

Pawel
 
Comment #5  (Posted by Piers Lawson on 08/25/2005)
Rating
As mentioned by another contributor, there are frameworks to help with this, such as log4net. An alternative that provides logging and exception handling is the Enterprise Library (EL) available for free from Microsoft. See msdn.microsoft.com/library/en-us/dnpag2/html/entlib.asp

Both these frameworks allow centralised logging to be configured both in terms of destination and levels. The EL also provides other well integrated features such as exception handling, data access, caching, configuration file handling.

I wrote an article introducing the Enterprise Library's logging features here: http://www.codeproject.com/dotnet/GetLoggingWithEntLib.asp
 
Comment #6  (Posted by Jparlato on 08/25/2005)
Rating
Thanks for putting this together. We can obviously choose variations for logging and other aspects, but this was useful - as is.

 
Comment #7  (Posted by Oli on 12/12/2005)
Rating
Great. Thanks....
 
Comment #8  (Posted by an unknown user on 08/09/2006)
Rating
Skimmed over the very basics without going into any detail. Good for juniors i suppose.
 
Sponsored Links