Configure Logging of Events when an Application Pool Recycles because of Non-Configured Recycling Events (IIS 7)

Applies To: Windows 7, Windows Server 2008, Windows Server 2008 R2, Windows Vista

You can configure IIS to log an event when an application pool recycles because of the following non-configured events:

  • On-demand: You recycle an application pool immediately to correct a problem.

  • Changes to Configuration: You make a change to a configuration setting that requires a recycle, such as a change to the <globalModules> section.

  • Unhealthy ISAPI: An ISAPI extension reports that it is in an unhealthy state to the worker process.

You can then view the log to determine when or how frequently an application pool recycles because of non-configured events. This can help you troubleshoot problems on the server, such as application problems caused by an ISAPI that reports itself unhealthy or by configuration changes that cause a worker process to recycle.


For information about the levels at which you can perform this procedure, and the modules, handlers, and permissions that are required to perform this procedure, see Application Pools Feature Requirements (IIS 7).

Exceptions to Feature Requirements

  • None

To configure logging of events when an application pool recycles because of non-configured recycling events

You can perform this procedure by using the user interface (UI), by running Appcmd.exe commands in a command-line window, by editing configuration files directly, or by writing WMI scripts.

User Interface

To use the UI

  1. Open IIS Manager. For information about opening IIS Manager, see Open IIS Manager (IIS 7).

  2. In the Connections pane, expand the server node and click Application Pools.

  3. On the Application Pools page, select an application pool, and then click Recycling in the Actions pane.

  4. On the first page of the Edit Application Pool Recycling Settings wizard, click Next.

  5. To log non-configured recycling events, select one or more of the following boxes:

    • On-demand

    • Configuration changes

    • Unhealthy ISAPI

  6. Click Finish.

Command Line

To configure IIS to log an event when an application pool recycles because of a non-configured event, use the following syntax:

appcmd set config /section:applicationPools /[name='string'].recycling.logEventOnRecycle:ConfigChange|OnDemand|IsapiUnhealthy

The variable string is the name of the application pool that you want to configure. For example, to configure IIS to log an event when an application pool named Marketing recycles because an ISAPI extension is unhealthy, type the following at the command prompt, and then press ENTER:

appcmd set config /section:applicationPools /[name='Marketing'].recycling.logEventOnRecycle:IsapiUnhealthy

For more information about Appcmd.exe, see Appcmd.exe (IIS 7).


The procedure in this topic affects the following configuration elements:

logEventOnRecycle attribute of the <recycling> element

For more information about IISĀ 7 configuration, see IIS Settings Schema on MSDN.


Use the following WMI classes, methods, or properties to perform this procedure:

  • ApplicationPool.Recycling.LogEventOnRecycle property

For more information about WMI and IIS, see Windows Management Instrumentation (WMI) in IIS 7. For more information about the classes, methods, or properties associated with this procedure, see the IIS WMI Provider Reference on the MSDN site.

See Also


Configuring Recycling Settings for an Application Pool (IIS 7)
Managing Application Pools in IIS 7