| Log4g Reference Manual | ||||
|---|---|---|---|---|
| Top | Description | ||||
The output of this layout consists of a series of Log4g log event elements. It does not output a complete well-formed XML document. The output is designed to be included as an external entity in a separate file to form a complete XML document.
For example, if "abc" is the name of the file where the XML layout output is directed, a well-formed XML document would be:
<?xml version="1.0" ?>
<!DOCTYPE log4g:events SYSTEM "log4g.dtd"
[<!ENTITY data SYSTEM "abc">]>
<log4g:events version="1.0" xmlns:lo4g="http://gnome.org/log4g/1.0/">
&data;
</log4g:events>
This approach enforces the independence of the XML layout and the appender where it is embedded.
XML layouts accept two properties:
properties
location-info
Setting properties to TRUE causes the XML layout to output all MDC (mapped
data context) values.
Setting the location-info property to TRUE will cause the XML layout to
include the log message location, i.e. function(file:line). The default
value is FALSE.