Microsoft KB Archive/815167

= HOW TO: Monitor Errors in .NET-Connected Applications =

Article ID: 815167

Article Last Modified on 4/30/2003

-

APPLIES TO


 * Microsoft .NET Framework 1.0
 * Microsoft ASP.NET 1.0
 * Microsoft ASP.NET 1.1
 * Microsoft .NET Framework 1.1

-



IN THIS TASK

 * SUMMARY
 * View .NET Framework Errors by Using the Event Viewer
 * View ASP.NET Errors Located in HTTP Logs
 * Monitor Errors in Real Time
 * REFERENCES



SUMMARY
This step-by-step article describes how to monitor errors in .NET-connected applications. The .NET-connected applications log errors in several different ways. Errors that occur in the .NET Framework itself are logged to the Application Event Log. For example, when ASP.NET recycles an application that exceeds the specified memory usage, an event is logged to the Application Event Log that details the quantity of memory that is consumed.

Most events that occur in an application are also logged to the Application Event Log. However, whether the event is logged or not logged is dependant on the application developer. ASP.NET applications frequently rely on the system administrator to parse the HTTP logs to identify HTTP 500 error codes. These error codes identify application failures. Instead of manually monitoring event logs and HTTP logs, administrators can use the Performance snap-in to detect when errors occur.

back to the top

View .NET Framework Errors by Using the Event Viewer
Any type of .NET-connected application, such as Microsoft Windows applications, Web services, and Web applications, can add events to the Application Event Log. You can monitor the Application Event Log to identify and to troubleshoot errors. To view .NET Framework errors by using the Event Viewer, follow these steps:
 * 1) On the taskbar, click start, point to Settings, and then click Control Panel.
 * 2) Double-click the Administrative Tools folder and then double-click to run the Event Viewer tool.
 * 3) In the left pane, select the Application Log.
 * 4) On the View menu, select Filter.

The Application Log Properties dialog box appears. The Filter tab is selected.
 * 1) To view events that are created by the .NET Framework, select .NET Runtime from the Event Source drop-down list. To view events that occurred in ASP.NET, select ASP.NET.
 * 2) To view the filtered Application Event Log, click OK.
 * 3) Double-click any event in the right pane to view detailed information about that event.

back to the top

View ASP.NET Errors Located in HTTP Logs
An error may occur in ASP.NET that the application cannot handle. In this case, Internet Information Server (IIS) logs the request and the response code in the HTTP logs. These logs do not contain a detailed description of the type of error that occurred. However, the log does contain information about the time of the request, the page requested, and the user who issued the request. This information permits you to reproduce and to isolate the error.

By default, HTTP logs are stored as text files in subfolders of the \%SystemRoot%\system32\LogFiles\W3SVC#\ folder. While there is no graphical tool that you can use to view the errors that are contained in HTTP logs, there are third-party applications that can analyze IIS log files.

When you interactively troubleshoot ASP.NET error messages, you can use trace capabilities to gather more detailed information about the failed requests.

back to the top

Monitor Errors in Real Time
ASP.NET Web applications that experience problems may not add events to the event log. In this case, you will find it difficult if you try to track those problems by parsing HTTP logs. You can use the Performance snap-in to monitor for ASP.NET errors in real time. To monitor ASP.NET errors by using the Performance snap-in, follow these steps:
 * 1) On the taskbar, click start, point to Settings, and then click Control Panel.
 * 2) Double-click the Administrative Tools folder and then double-click to run the Performance tool.
 * 3) Select System Monitor in the left pane.
 * 4) In the right pane, click Add on the toolbar.
 * 5) In the Performance Object drop-down list, click ASP.NET Applications.
 * 6) Select Errors Total from Select Counters From List.
 * 7) Under Select Instances From List, select the application that you want to monitor or select Total to monitor all applications.
 * 8) Click Add and then click Close.

The Errors Total counter keeps a running total of ASP.NET errors. You can use this counter to detect problems that must be investigated.

back to the top

