WHAT’S IN THIS CHAPTER?
WROX.COM CODE DOWNLOADS FOR THIS CHAPTER
This chapter explains how to get real-time information about your running application in order to identify any issues that it might have during production or to monitor resource usage to ensure that higher user loads can be accommodated. This is where the namespace
System.Diagnostics comes into play. This namespace offers classes for tracing, event logging, performance counts, and code contracts.
One way to deal with errors in your application, of course, is by throwing exceptions. However, an application might not fail with an exception, but still not behave as expected. The application might be running well on most systems but have a problem on a few. On the live system, you can 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. The Event Viewer is a commonly used tool that not only the system administrator ...