XSLTLayout transforms each event as a document using
a specified or default XSLT transform. The default
XSLT transform produces a result similar to XMLLayout.
When used with a FileAppender or similar, the transformation of
an event will be appended to the results for previous
transforms. If each transform results in an XML element, then
resulting file will only be an XML entity
since an XML document requires one and only one top-level element.
To process the entity, reference it in a XML document like so:
<!DOCTYPE log4j:eventSet [<!ENTITY data SYSTEM "data.xml">]>
<log4j:eventSet xmlns:log4j="http://jakarta.apache.org/log4j/">
&data
</log4j:eventSet>
The layout will detect the encoding and media-type specified in
the transform. If no encoding is specified in the transform,
an xsl:output element specifying the US-ASCII encoding will be inserted
before processing the transform. If an encoding is specified in the transform,
the same encoding should be explicitly specified for the appender.
Extracting MDC values can be expensive when used with log4j releases
prior to 1.2.15. Output of MDC values is enabled by default
but be suppressed by setting properties to false.
Extracting location info can be expensive regardless of log4j version.
Output of location info is disabled by default but can be enabled
by setting locationInfo to true.
Embedded transforms in XML configuration should not
depend on namespace prefixes defined earlier in the document
as namespace aware parsing in not generally performed when
using DOMConfigurator. The transform will serialize
and reparse to get the namespace aware document needed.