You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4net-dev@logging.apache.org by rodchar <ro...@hotmail.com> on 2009/02/20 17:25:52 UTC

extending the fileappender

hi all,

what's the easiest way to extend the fileappender? i'd to add what user
logged it and what class it came from?

thanks,
rodchar
-- 
View this message in context: http://www.nabble.com/extending-the-fileappender-tp22120783p22120783.html
Sent from the Log4net - Dev mailing list archive at Nabble.com.


Re: extending the fileappender

Posted by Ron Grabowski <ro...@yahoo.com>.
If you follow the recommendation of creating your loggers based on the current class you can use the %logger pattern to display what class the message came from. There is also a %username pattern. 

If you have a custom user name that is stored in something like the ASP.Net Session you can use store that value as a property then extract is using the %property{myUserName} pattern:

http://logging.apache.org/log4net/release/sdk/log4net.Layout.PatternLayout.html



----- Original Message ----
From: rodchar <ro...@hotmail.com>
To: log4net-dev@logging.apache.org
Sent: Friday, February 20, 2009 11:25:52 AM
Subject: extending the fileappender


hi all,

what's the easiest way to extend the fileappender? i'd to add what user
logged it and what class it came from?

thanks,
rodchar
-- 
View this message in context: http://www.nabble.com/extending-the-fileappender-tp22120783p22120783.html
Sent from the Log4net - Dev mailing list archive at Nabble.com.