We use the FormattedDatabaseTraceListener. We need to take an item from ExtendedProperties and add it as a new parameter to the logging stored procedure which will in turn write the information to the database.
My first idea was to extend the existing FormattedDatabaseTraceListener. But this doesn't work because the methods that execute the stored procedure are private.
My next idea was to extend the CustomTraceListener, add identical code from FormattedTraceListener. This works.
The problem comes when I try to configure the new TraceListener in the configuration utility. The ConfigurationElementType has to be set to "CustomTraceListenerData". Problem: the CustomTraceListenerData type lists only the configuration elements associated with the CustomerTraceListener type; I need the elements from the FormattedDatabaseTraceListener type, which includes items such as stored procedure names, etc. I tried to use the FormattedDatabaseTraceListenerData ConfigurationElementType, but no dice - the configuration editor tells me that the type is not derived from CustomTraceListener.
I've read that I can build my own ConfigurationElementTypes - and even my own Application Block - but it seems likely that someone, somewhere has run into the need to add their own properties to the database trace listener. Any help anyone could offer would be appreciated.