Pat,

Simplest option would be to use MDC (Mapped Diagnostic Context) to include 
any specific information that you want to and then retrieve it through 
PatternLayout in your ADO.NET appender.

Links: 
http://logging.apache.org/log4net/release/manual/contexts.html
http://logging.apache.org/log4net/release/manual/configuration.html#HC-11869225

Regards,
Kiran Raja




"Patrick Cheng" <[EMAIL PROTECTED]> 
12/28/2004 03:46 AM
Please respond to
"Log4NET User" <[email protected]>


To
"Log4NET User" <[email protected]>
cc

Subject
Question on Logging customized information






Hi,
I would like to log some data via ADONETAppender into my own log table. 
Say, my table LOG has column A(varchar(100)) and B (varchar(100)).
I do not want to log the default information such as %logger %thread 
%logdate etc...
instead i want to log my own A and B values into the database. 
 
I am able to get it done if i only have one value , ie, A, by setting 
PatternLayout = "%m", 
and calling the log.Debug("test"), the "test" will go into the db.
but is there a way to pass in more than 1 value? 
(the worst case, i will concatenate A and B into 1 string and break it 
down in sql statement... but any alternative?)
 
Thank you,
 
Pat



The information transmitted is intended only for the person or entity to which 
it is addressed and may contain CONFIDENTIAL material.  If you receive this 
material/information in error, please contact the sender and delete or destroy 
the material/information.

Reply via email to