By default, IIS does not record worker-process recycle events. However, you can enable the specified worker process to recycle event records. Unlike other IIS activities that are recorded at your designated location and file, worker process recycle events are written to the system event log.
Logging worker Process Recycling events helps troubleshoot IIS. For example, when troubleshooting an ISAPI extension that performs a new server support feature Report_unhealthy, you can specify that IIS record each ISAPI self report as an example of a bad state.
The following table describes the worker process recycle events that you can record. To log events, set the corresponding Metabase property to True.
Metabase Property Description
Apppoolrecycletime
Record events with time as the basis for recycling.
Apppoolrecyclerequests
Log events as a recycle base.
Apppoolrecycleschedule
Log events by scheduling as the basis for recycling.
Apppoolrecyclememory
Record events using memory as the basis for recycling.
Apppoolrecycleisapiunhealthy
Because ISAPI reports are in poor state, events are logged when worker processes require recycling.
Apppoolrecycleondemand
Events are logged when the system administrator requires that all the processes in the application area be reclaimed.
Apppoolrecycleconfigchange
If the application assembly area is reclaimed because one of the application assembly properties that requires recycling is changed, the event is logged.
Apppoolrecycleprivatememory
Events are logged if the application assembly area is reclaimed according to private memory.
Important matters
You must be a member of the Administrators group on the local computer to execute the specified code and the execution file. The best security approach is to log on to your computer using an account that is not a Administrators group, and then use the runas command to execute the script or file as a system administrator. In the command prompt character input runas/profile/user:mycomputeradministrator cmd, open the Command window with system administrator privileges, and enter Cscript.exe ScriptName ( Contains the full path of the script and any parameters).
Program
Enable records for worker process recycling
1. Click [Execute] on the [Start] menu.
2. In the [Open] box, type cmd, and then click [OK].
3. Type the following in the command prompt character, and then press the ENTER key. CD%systemroot%inetpubadminscripts
4. Type the following in the command prompt character, and then press the ENTER key. cscript adsutil.vbs set w3svc/apppools/apppoolname/eventname true
Replace AppPoolName with the name of the application assembly area, and replace EventName with the event name you want to record. For example, the following command records the memory-based recycle events of a preset AppPool: csript adsutil.vbs set w3svc/apppools/defaultapppool/apppoolrecylememory true