logging-log4net-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Georg Jansen" <Georg.Jan...@FaktNet.com>
Subject RE: how can i add my custom infomaition
Date Sat, 24 Sep 2005 13:23:11 GMT
Hi,

One approach to this issue is to takes advantage of Log4net's
Thread.Context.Properties

For example 
log4net.ThreadContext.Properties["UserName"] = UserName
                   
And then use the PatternLayout:
  <layout type="log4net.Layout.PatternLayout">
     <conversionPattern value="%thread User=%property{UserName}"/>
  </layout>

I have written a short article about this method on:
www.l4ndash.com/Articles/Trackingusersessionsinlog4net/tabid/59/Default.aspx

Georg
L4NDash - Log4Net Dashboard www.l4ndash.com


-----Original Message-----
From: Johnny [mailto:danjingxiu@gmail.com] 
Sent: 23. september 2005 11:08
To: 'Log4NET User'
Subject: how can i add my custom infomaition

Hi,
	When I using log4net's AdoAppender,I have a problem, because the
log4net framework default provide logger,logtime,logLevel,message,etc,but I
want to adds extra information like the username, department, etc.so what
can I do? I don't know how to implement it .can you help me ? thanks very
much.




Mime
View raw message