Database Trace Listener - Text Formatter

Topics: Logging Application Block
Jul 20, 2009 at 3:11 AM

I'm using the database trace listener, im just thinkin , if I edit the text template on the formatter will it affect the columns where it will log? say, if i remove the Title Column from the template will it not log to the actual column in the database? Or is there a way to do that to have specific columns filled up?


Thank you.

Jul 20, 2009 at 12:03 PM


Editing the Template of the Text formatter will only affect the formattedMessage column in the database but there will still be values on the other columns. One thing you can do to have a specific columns filled up is to create your own stored procedure and use it or you might want to modify the WriteLog stored procedure which comes with ent lib and just change the values of the parameter in the insert statement to null (for the column that accepts null). but I think there will be just some column that you can ignore, most of the columns doesn't accept null. You also have the option to modify the table structure to address your need.

Valiant Dudan
Global Technology and Solutions
Avanade, Inc.