I want to add a new column to the DB schema so that I can log customer IDs
as a separate colum.

 

The table currently looks like this:

 

Id        int        

Date    datetime          

Thread varchar(255)   

[Level]            varchar(50)     

Logger            varchar(255)   

Message          varchar(4000) 

Exception       varchar(2000) 

Context           varchar(255)   

 

I want to add a new column and modify log4net to write a specific value to
the new column for all new log messages.

 

Then I want to either overload the logging methods so I can manually specify
a customer ID as a parameter like this:

log.Info(customerId, ”This is a customer specific log message”,
someException);

 

Or maybe pick up the customer ID automatically based on a session variable
or something.

 

 

 

 

From: Karim Bourouba [mailto:[email protected]] 
Sent: 17. august 2009 11:38
To: [email protected]
Subject: RE: Adding a new column

 

Do you mean adda new column to be logged? If you do, then you can use
&property(MY CUSTOM PROPERTY HERE) in the config file. Complimented with
log4net.GlobalContext.Properties["taskname"] = _taskName; in your code to
capture your custom column name (assuming it is called "taskname". 

  

If you are talking about your DB, then thats something outwith log4net I
think.



  

  _____  

From: [email protected]
To: [email protected]
Subject: Adding a new column
Date: Mon, 17 Aug 2009 11:25:02 +0200

Hi,

 

I’m using ADONetAppender and now I want to add a separate column where I can
automatically log a customer ID for each log entry. How do I go about to
implement this? 

 

/Henning

 

 

 

  _____  

Windows Live Messenger: Happy 10-Year Anniversary—get free winks and
emoticons. Get Them <http://clk.atdmt.com/UKM/go/157562755/direct/01/>  Now

Reply via email to