Chapter 17: Tracing and Events


Overview

Chapter 13 of this book covered errors and exception handling. However, besides handling exceptional code it might be really interesting to get some live information of your running application. This is where the namespace System.Diagnostics comes into play.

The application doesn’t throw exceptions, but sometimes it doesn’t behave as expected. The application might be running well on most systems, but there’s a problem on a few. On the live system, you change the log behavior by changing a configuration value and get detailed live information about what’s going on in the application. This can be done with tracing.

If there are problems with applications the system administrator needs to be informed. With the Event Viewer the system administrator both interactively monitors problems with applications and gets informed about specific events that happen by adding subscriptions. The event-logging mechanism allows you to write information about the application.

To analyze resources needed from applications, monitor applications with specified time intervals, plan for a different application distribution or extending of system resources, the system administrator is using the performance monitor. You can write live data of your application using performance counts.

This chapter explains these three facilities and demonstrates how you can use them from your applications:

  • Tracing

  • Event logging

  • Performance monitoring




Professional C# 2005 with .NET 3.0
Professional C# 2005 with .NET 3.0
ISBN: 470124725
EAN: N/A
Year: 2007
Pages: 427

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net