IIS 7.0 - Application Pool Recycles - Log a event in Windows Event Log
This is my 1st blog post on IIS 7.0.
Application Logging
Apart from the standard IIS logs type, other items can be logged. Many of these options can be set in UI using the IIS Manager or by using Appcmd.exe - IIS command line administration Tool.
Application Pool - Process Recycling Logging
In IIS 7.0, events are logged to the Windows event log when an application pool recycles. You can control eight recycling application pool configuration settings with each option listed in Table below:
Recycling Options Under Generate Recycle Event Log Entry | ||
Option
|
Description
|
Default Setting
|
Application Pool Configuration Changed
|
Event is logged when the application pool recycles due to a change in its configuration
|
No
|
ISAPI Report Unhealthy
|
Event is logged because an ISAPI extension has reported itself as unhealthy
|
No
|
Manual Recycle
|
Event is logged when the application pool has been manually recycled
|
No
|
Private Memory Limit Exceeded
|
Event is logged when the application pool recycles after exceeding its private memory limit
|
Yes
|
Regular Time Interval
|
Event is logged when the application pool recycles on its scheduled interval
|
Yes
|
Request Limit Exceeded
|
Event is logged when the application pool recycles after exceeding its request limit
|
No
|
Specific Time
|
Event is logged when the application pool recycles at a scheduled time
|
No
|
Virtual Memory Limit Exceeded
|
Event is logged when the application pool recycles after exceeding its virtual memory limits
|
Yes
|
In IIS Manage UI, you can find above options as below:
1. Open IIS Manager
2. Go application pools.
3. Highlight the application pool and select "Advanced Settings".
4. Under Recycling, Expand "Generate Recycle Event Log Entry"
Classic ASP Error Logging:
For Classic ASP (Active Server Pages) in IIS 7.0, you can configure options for logging ASP errors under the ASP section in the IIS Manager. You may use the following options to discover issues when migrating your Classic ASP applications to IIS 7.0.
- Enable Log Error Requests - Controls whether the Web server writes ASP errors to the application event log
- Log Errors To The NT Log - Specifies that ASP errors are recorded in the Windows event log
Note: These options are also available in IIS 6.0, but you have to use ADSUtil.vbs to enable them in the metabase. Now, in IIS 7.0, you can use the IIS Manager to enable these options or use command line appcmd.exe tool.
All ASP.NET 2.0 unhandled exceptions are always written to the Application Event log. Along with application pool recycle events or other errors in the event logs, this can be very helpful in troubleshooting application errors. It is always a good idea to debug Unhandled Exceptions in ASP.NET. See following blogs for more information:
Debugging Unhandled Exceptions in ASP.NET
Learning how to Debug ASP.NET App Issues (Memory Leaks, Crashes, Deadlocks, etc)
IIS 6.0 Events Reference
IIS logs events in the windows event viewer which helps to analyze performance and troubleshooting. Review "Event Reference" for more information.