あなたのアプリケーションまたはIISのすべてのアプリケーションだけヘルスモニタリングを行いますか?
IHttpModuleからクラスを作成して派生させることができ、Initメソッドでは、要求やその他の状態を監視するためにイベント通知を作成することができます。
public class MyMonitor : IHttpModule
{
public void Init(HttpApplication context)
{
// you can watch any of such events and respond accordingly
context.BeginRequest += new EventHandler(context_BeginRequest);
context.PostUpdateRequestCache +=
new EventHandler(context_PostUpdateRequestCache);
context.Error += new EventHandler(context_Error);
}
.....
}
そして、あなたはあなたのweb.configファイルに次の行を追加することができます
<httpModules>
<add name="MyMonitor" type="Namespace.MyMonitor"/>
</httpModules>