You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4net-user@logging.apache.org by Nicko Cadell <ni...@neoworks.com> on 2005/06/02 19:53:24 UTC

RE: How to create XmlAppender

[Moved to the log4net-user list]

You can configure a FileAppender to use the built-in XmlLayout, this
will generate a file containing the logger, level, message and more for
each event. The configuration is as follows:

<appender name="XmlFileAppender" type="log4net.Appender.FileAppender">
  <file value="app.log" />
  <layout type="log4net.Layout.XmlLayout" /> 
</appender>

If you need a different XML output format then you can write your own
layout class similar to the XmlLayout (in the download see
src/Layout/XmlLayout.cs, or on the web
http://cvs.apache.org/viewcvs.cgi/logging-log4net/src/Layout/XMLLayout.c
s?rev=1.10&view=markup).

Nicko

> -----Original Message-----
> From: madhu k [mailto:kmadhu_babu@india.com] 
> Sent: 19 May 2005 13:06
> To: log4net-dev@logging.apache.org
> Subject: How to create XmlAppender
> 
> 
> Hi all,
> 
> i wanted to an idea to how to create a XmlAppender and i need 
> to be log messages with date of log, level,message, logger.
> 
> please help me.
> 
> madhu babu k
> 
> 
> --
> India.com free e-mail - www.india.com. 
> Check out our value-added Premium features, such as an extra 
> 20MB for mail storage, POP3, e-mail forwarding, and ads-free 
> mailboxes!
> 
> Powered by Outblaze
> 
>