[This is preliminary documentation and subject to change]

# About Windows Events

Logging begins automatically whenever Windows is started. There are three types of logs: System, Security, and Application. For each type of log, you can filter the events to be viewed, designate the number of entries to view, decide how long to save entries, and decide whether to automatically overwrite existing events when the log becomes full.

There are several ways to open the Event Viewer:

- Click Start, select Run, and type eventvwr in the Open text box. Press ENTER.
- Type start eventvwr in a command window, and press ENTER.
- Click Start, select Programs, select Administrative Tools, and select Event Viewer.
- Click Start, select Programs, select Administrative Tools, and select Computer Management. Event Viewer is listed under the System Tools node. The benefit of this display is that the IIS snap-in is in the same window under the Services and Applications node.

## ASP Errors and the Windows Event Log

In the Event Viewer, you can open the property pages for each type of log and configure the filter options that generally apply to all events.

IIS increases the degree of control by providing two metabase keys that allow you to specify what is sent to the Windows Event log when ASP errors occur.

- AspLogErrorRequests: If this key is set to TRUE, IIS allows ASP errors to be sent to the Application event log. If the key is set to FALSE, no ASP errors are sent. This key can be set in the IIS snap-in or set programmatically. In the IIS snap-in, display the properties of a virtual directory, set the Application Protection to High (Isolated), and click Configuration. Click the Process Options tab, and select the Write unsuccessful client requests to event log checkbox. When checked, this metabase key is set to TRUE.
- AspErrorsToNTLog: If this key is set to TRUE, all possible ASP errors are sent to the Application event log. If this key is set to FALSE, only a subset of all ASP errors is sent. The subset includes the error numbers 100, 101, 102, 103, 104, 105, 106, 107, 115, 190, 191, 192, 193, 194, 240, 241, 242. This key cannot be set in the IIS snap-in, and must be set programmatically.

For descriptions of ASP Event errors, see Active Server Pages Events.

For more information on the metabase and programmatic administration of IIS, see Programmatic Administration. A quick way to set these keys is to use the adsutil.vbs script sample in X:\inetpub\adminscripts, where X: is the drive on which you installed IIS. For example, to send the subset of ASP Event errors to the Windows Event log, type the following lines in a command window:

       /cscript adsutil.vbs SET
    w3svc/1/root/<vdir_name>/AspLogErrorRequests
    TRUE/

       /cscript adsutil.vbs SET
    w3svc/1/root/<vdir_name>/AspErrorsToNTLog FALSE/

Note ASP errors can also be logged to the IIS log files. This is configured in the IIS snap-in. If logging an ASP error to the IIS log file fails, the error will be sent to the Windows Event Log.

© 1997-2001 Microsoft Corporation. All rights reserved.