[ 
http://issues.apache.org/jira/browse/LOG4NET-5?page=comments#action_59902 ]
     
Nicko Cadell commented on LOG4NET-5:
------------------------------------

We already have ILayout which writes text, IRawLayout which returns an object. 
We should add IXmlLayout which generates XML in some form (likely to an 
XmlWriter). The current implementations of ILayout that extend XmlLayoutBase 
would need to be changed to use this new IXmlLayout interface. The current code 
in XmlLayoutBase would be moved into an XmlLayout2LayoutAdapter which would 
convert the XML to text allowing the IXmlLayout object to be used with 
Appenders that only expect ILayouts.

> Support layouts that generate XML instead of text
> -------------------------------------------------
>
>          Key: LOG4NET-5
>          URL: http://issues.apache.org/jira/browse/LOG4NET-5
>      Project: Log4net
>         Type: Improvement
>   Components: Core
>     Versions: 1.2.9
>  Environment: From sourceforge - 795051 - Curt Arnold
>     Reporter: Nicko Cadell

>
>  I recently wrote an appender to an destination that could
> only accept XML documents and a custom layout that
> implemented the specific schema that it accepted.
> Unfortunately, only at that point did I realized that
> FormatXml was protected.
> I've hacked my copy to make XmlLayoutBase.FormatXml
> public to allow me to acheive my objectives without adding
> the complexity of serializing to a string and then trying to
> fixup encoding or other issues or reparsing.
> The XmlLayoutBase.Format went through a huge amount of
> complexity to efficiently produce string representations from
> calls to FormatXml. While that code could be retained for
> compatibility with arbitary appenders, I think the following
> would be beneficial.
> 1. Introduce an Xml specific layout interface containing
> FormatXml (say IXmlLayout)
> 2. Have XmlLayoutBase implement IXmlLayout
> 3. Have the file appenders check if the layout supports
> IXmlLayout, if it does then create one XmlWriter for the file
> and only use IXmlLayout.FormatXml in Append.
> Curt Arnold

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira

Reply via email to