views:

17

answers:

1

I'm logging exceptions to a database using a DatabaseTraceListener from Enterprise Library (code is pretty much as described here). Now I want to create another field in the database table and log some custom information (user id) there.

From what I understand I have to subclass CustomTraceListener and LogEntry, but I can't find any information how to proceed. Can anyone please post an example or point me in the right direction?

+1  A: 

You can write your own database trace listener and implement ExecuteWriteLogStoredProcedure method as the way you want and add a column to your Logging database. and reference to this Trace listener instead of default logging database trace listener. you can see the related source code for default trace listener in related source code, Also you can use categories for doing this. Also see this

SaeedAlg