Search code examples
asp.nethealth-monitoring

Add columns to SqlWebEventProvider


In an ASP.NET application, we'd like to use the SqlWebEventProvider to log any Event that occurs during the application lifetime.

The problem is that we think that the table aspnet_WebEvent_Event doesn't provide enough columns and should log more information (we need to keep the Logged user).
I'm aware that this information could be stored in the "Details" column but it wouldn't then be really simple to filter the results and build reports.

So I'm searching for a simple solution to add a column. I wish I could derive SqlWebEventProvider but the methods used to build the stored procedure parameters are private (PrepareParams() and FillParams()).

Any simple solution that doesn't imply to rewrite the entire Provider class ?


Solution

  • After a lot of searching it seems that it is not possible without inheriting from the existing SqlWebEventProvider and overriding the methods properly to insert the values.

    You can look into the .NET Framework code to check for the current implementation with .Net Reflector