ASP.NET 2.0 introduced a new feature which is called Health Monitoring. Health Monitoring allows you to have the information about your website. This information can contain everything including startup and stopping of the application, errors, events etc. You can easily enable the Health Monitoring services by doing small settings in web.config file.

Simply run the aspnet_regsql.exe from the Visual Studio.NET 2005 command prompt. This will guide to enable the different services on your database. When the wizard is finished you will see the table aspnet_WebEvent_Event created in your targeted database.

The next task is to do the configuration in web.config file.

<!-- Health Monitoring System -->

<healthMonitoring>

<providers>

<add name="MySqlEventProvider" connectionStringName="ConnectionString"

maxEventDetailsLength="1073741823"

buffer="false" bufferMode="Notification"

type="System.Web.Management.SqlWebEventProvider,

System.Web,Version=2.0.0.0,Culture=neutral,

PublicKeyToken=b03f5f7f11d50a3a" />

</providers>

<rules>

<add eventName="All Events" name="LogAllEvents" provider="MySqlEventProvider"/>

</rules>

</healthMonitoring>

And this is all you need. Now when you run your application all the events are noted in the aspnet_WebEvents_Event table of your database.