I have created a custom database trace listener by inheriting the custom trace listener. What I have done is I have added 2 new columns to the database log table and I have modified the WriteLog procedure also to add 2 new parameters. I changed the text
formatter to include those two properties.
I have created two listeners. One is Event log listener and other is the custom DB listener which uses the text formatter.
My problem is what ever the two columns I have added, I am not getting the formattedMessage column correctly in the database. But in event log the message is cominig correctly.
I have done the following steps
1) Extend LogEntry class and create a new class called "ExtLogEntry" class
2) create a new custom DB trace listener called "ExtDBTraceListener" by inheriting "CustomTraceListener"
3) Override the TraceData and Write(Object o) method and add those 2 new parameters to the stored procedure call like below
false, 0, 0,
4) In the config file refer the above custom DB listener and set the formatter as Text Formatter.
5) I have modified the Text Formatter class to include the newly added properties.
<font size="2" color="#0000ff"><font size="2" color="#0000ff">
</font></font><font size="2" color="#0000ff">
After that I ran the application, I can see the formattedMessage column is not formatted correctly. Both Message and the formattedMessage columns have the same value.
I want the formattedMessage column to have the message formatted.
Could you please let me know what to do to get the correct formatted message in database table?