5

I'm writing a .NET service that monitors application pools. based on specific triggers I'm restarting them. However, I do not want to restart them if the trigger occurred before they were recycled for the last time. How can I know the "last recycle time" of an app pool?

4

2 回答 2

2

如果LogEventOnRecycle设置了该属性,您应该能够使用EventLog Class

于 2011-08-24T02:55:53.270 回答
0

我钻进了查看事件日志的兔子洞,我能够检测到最后一次回收应用程序池的时间,但它非常占用 CPU,因为您必须从磁盘读取日志。我强烈建议使用

Process.GetCurrentProcess().StartTime
于 2012-09-19T18:57:44.567 回答