Enabling Instrumentation

Retired Content

This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This page may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.

The latest Enterprise Library information can be found at the Enterprise Library site.

The term instrumentation refers to a system's ability to monitor or measure performance and to diagnose errors. For general information about instrumentation, see Monitoring in .NET Distributed Application Design.

The Enterprise Library incorporates the following instrumentation into all of its application blocks:

  • Event logs. The application blocks inform users of key events, such as errors or warnings.
  • Performance counters. The application blocks record key metrics—such as the number of critical events that occur per second or the average time it takes to complete key tasks—by writing to the Microsoft Windows operating system performance counters.
  • Windows Management Instrumentation (WMI). The application blocks report significant events within the application blocks by publishing WMI events.

Enabling and Disabling Instrumentation

By default, instrumentation is disabled. To enable instrumentation, you must install the instrumentation schema and configure your application.

Installing and Uninstalling the Instrumentation Schema

To install the instrumentation schema, you can either run the InstallServices.bat batch file or you can use the Install Instrumentation shortcut on the Start menu. To use the shortcut, click Start, point to All Programs, point to Microsoft patterns & practices, point to Enterprise Library 3.1 – May 2007, and then click Install Instrumentation.

To uninstall instrumentation, you can either run the InstallServices.bat batch file with the /u parameter, or you can use the Uninstall Instrumentation shortcut on the Start menu. To use the shortcut, click Start, point to All Programs, point to Microsoft patterns & practices, point to Enterprise Library 3.1 – May 2007, and then click Uninstall Instrumentation.

Note

The Start menu link always runs against the strong-named binaries. To install instrumentation against a copy of the assemblies compiled from the source code, run [Src install root]\App Blocks\InstallServices.bat.

Configuring an Application for Instrumentation

Instrumentation is controlled by the <instrumentationConfiguration> section of the application's configuration file. This section determines how instrumentation behaves for the entire application.

By default, each type of instrumentation is disabled. You can use configuration to enable each type of instrumentation or to disable instrumentation if you have previously enabled it. All instrumentation properties appear in the right pane. When a property is set to True, the instrumentation is enabled. When a property is set to False, the instrumentation is disabled.

To configure instrumentation

  1. Start the configuration console. To use the configuration console, click Start, point to AllPrograms, point to Microsoftpatterns&practices, point to Enterprise Library 3.1– May 2007, and then click Enterprise Library Configuration.
  2. Click New Application or Open Existing Application.
  3. Right-click Application Configuration, point to New, and then click Instrumentation.
  4. Set the EventLoggingEnabled property. Type True or False or click either option on the drop-down list. The default value is False.
  5. Set the PerformanceCountersEnabled property. Type True or False or click either option on the drop-down list. The default value is False.
  6. Set the WmiEnabled property. Type True or False or select either option on the drop-down list. The default value is False.
Retired Content

This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This page may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.

The latest Enterprise Library information can be found at the Enterprise Library site.