logging-log4net-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Fahad Sarwar" <fsar...@opaltelecom.co.uk>
Subject Extending Log4Net
Date Tue, 17 Jan 2006 10:06:12 GMT
I have just started to use the latest version of log4net 1.2.9 and would
like to know how best to extend its capabilites to do what i need.  We
currently have our own logging application which takes an object called
LogEntry (containing 5 parameters including a Message field) and makes use
of MSMQ and WebService technology.  
It is easy enough to write an Appender which extends AppenderSkeleton and
overrides the Append method to make a call to the WebService.  But the
difficulty is getting the LogEntry object to the Appender to send to the
WebService.  What would be the best way to do this?  I guess itll involve
the DefaultRenderer class in someway but not sure how to use this or how to
extend it to pass on the LogEntry object.  
Within our code we use the patternlayout as its the most flexible and
provides the most information.  I would like to extend this class to log
each item within the LogEntry object as a seperate attribute, i.e.
LogEntry.Category can use %cat, LogEntry.Application %app etc.  However i
would like the LogEntry.Message property to use the %m / %message tag and
dont want every property within object to outputted to an appender when %m /
%message is used.  Any ideas how this can be achieved?

Fahad Sarwar

Opal Telecom

Applications Team


Tel: +44 161 222 2145

Fax: +44 161 222 2008

Email: fsarwar@opaltelecom.co.uk 


This communication together with any attachments transmitted with it ("this
E-Mail") is intended only for the use of the addressee and may contain
information which is privileged and confidential. If the reader of this
E-Mail is not the intended recipient or the employee or agent responsible
for delivering it to the intended recipient you are hereby notified that any
use, dissemination, forwarding, printing or copying of this E-Mail is
strictly prohibited. Addressees should check this E-mail for viruses. The
Company makes no representations as regards the absence of viruses in this
E-Mail. If you have received this E-Mail in error please notify our IT
Support Team immediately by telephone on 0845 456 9100 or via e-mail at
support@opaltelecom.co.uk Please then immediately delete, erase or otherwise
destroy this E-Mail and any copies of it.

Any opinions expressed in this E-Mail are those of the author and do not
necessarily constitute the views of the Company. Nothing in this E-Mail
shall bind the Company in any contract or obligation.

For the purposes of this E-Mail "the Company" means Opal Telecom Ltd.
Please feel free to visit our website:  <http://www.opaltelecom.co.uk/>

Opal Telecom Ltd (Registered in England & Wales No. 3849133) 

Brinell Drive, Northbank Industrial Park, Irlam, Manchester M44 5BL.

A member of the Carphone Warehouse Group of Companies


View raw message