How to find out why an ASP.NET web application is being restarted

你离开我真会死。 提交于 2019-11-29 00:43:05
PHeiberg

Tess Ferrandez wrote a good blog post on how to determine the reason for App Domain recycling. Tess has this to say on how to log the restart event:

How do you determine what caused an appdomain restart? In ASP.NET 2.0 you can use the built in Health Monitoring Events to log application restarts along with the reason for the restart. To do this you change the master web.config file in the C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\CONFIG directory and add the following section

<healthMonitoring>
  <rules>
    <add name="Application Lifetime Events Default" 
         eventName="Application Lifetime Events"
         provider="EventLogProvider" profile="Default" minInstances="1"
         maxLimit="Infinite" minInterval="00:01:00" custom="" />

To turn on logging for IIS6 you can use:

cscript adsutil.vbs Set w3svc/AppPools/DefaultAppPool/LogEventOnRecycle 255

For IIS7 you can control it from the IIS manager - Application pools - Advanced Settings.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!