title: Log IIS Application Pool Startup, Shutdown, and Recycle
body: <p>My application is running in a shared hosting environment. I do have a dedicated App Pool for my app. I've been doing some testing with 1st visits and precompile performance and have been tracking when my application starts up and shuts down.</p>
  
  <p>In my Global.asax I have some logging code in Application_Start and Application_End. I can see from my logs generally when the application is idle and shuts down, then someone visits and it starts back up. </p>
  
  <p>But, I also see cases where a shutdown is logged and then followed by another shutdown about 13 minutes later; without a startup in the middle. </p>
  
  <p>I also see instances where there are two Startups in a row. I'm guessing these might be a recycle, but why wouldn't there be a shutdown log entry?</p>
  
  <p>What I'd really like to know if there is a better way to track when my application starts, when it shuts down and if it is shutdown due to an idle pool, or from a recycle. I don't have access to the Windows Event Log so I need to do this from my app if possible.</p>