blob: 64aac6bbb800f22b1f154ba9c8e389f328725ce9 [file] [log] [blame]
<html>
<head>
<title>
log4cxx - Documentation
</title>
<link href="../css/doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body bgcolor="#ffffff" text="#000000" link="#525D76">
<!-- START Header table -->
<table border="0" cellspacing="0" width="90%">
<!-- TOP IMAGE -->
<tr>
<td colspan="2">
<a href="http://logging.apache.org">
<img src="http://logging.apache.org/images/ls-logo.jpg" align="left" border="0"/>
</a>
</td>
</tr>
</table>
<!-- END Header table -->
<!-- START main table -->
<table id="main" border="0" width="90%" cellspacing="2" cellpadding="0">
<tr><td colspan="2">
<hr noshade="" size="1"/>
</td></tr>
<tr>
<!-- LEFT SIDE NAVIGATION -->
<td id="navbar" valign="top">
<!-- ============================================================ -->
<table id="navbar" border="0" cellspacing="0" cellpadding="0">
<tr >
<td class="navbarHeader" nowrap="true">
<strong>Apache</strong>
</td>
</tr>
<tr><td class="navbarItem"><small> <a href="http://www.apache.org">Apache Home</a>
</small></td></tr>
<tr><td class="navbarItem"><small> <a href="http://logging.apache.org/">Logging Services</a>
</small></td></tr>
<tr >
<td class="navbarHeader" nowrap="true">
<strong>log4cxx project</strong>
</td>
</tr>
<tr><td class="navbarItem"><small> <a href="../index.html">About</a>
</small></td></tr>
<tr><td class="navbarItem"><small> <a href="../news.html">News</a>
</small></td></tr>
<tr><td class="navbarItem"><small> <a href="../team.html">Team</a>
</small></td></tr>
<tr><td class="navbarItem"><small> <a href="../manual/index.html">Documentation</a>
</small></td></tr>
<tr><td class="navbarItem"><small> <a href="../performance.html">Performance</a>
</small></td></tr>
<tr><td class="navbarItem"><small> <a href="../download.html">Download</a>
</small></td></tr>
</table>
</td>
<td id="mainContents" align="left" valign="top">
<hr>
<!-- Generated by Doxygen 1.3.5 -->
<div class="qindex"><a class="qindex" href="index.html">Main&nbsp;Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="hierarchy.html">Class&nbsp;Hierarchy</a> | <a class="qindex" href="classes.html">Alphabetical&nbsp;List</a> | <a class="qindex" href="annotated.html">Class&nbsp;List</a> | <a class="qindex" href="functions.html">Class&nbsp;Members</a></div>
<h1>XMLLayout Class Reference</h1>Inheritance diagram for XMLLayout:<p><center><img src="classlog4cxx_1_1xml_1_1XMLLayout__inherit__graph.png" border="0" usemap="#XMLLayout__inherit__map" alt="Inheritance graph"></center>
<map name="XMLLayout__inherit__map">
<area href="classlog4cxx_1_1Layout.html" shape="rect" coords="84,168,134,192" alt="">
<area href="classlog4cxx_1_1spi_1_1OptionHandler.html" shape="rect" coords="6,93,102,117" alt="">
<area href="classlog4cxx_1_1helpers_1_1Object.html" shape="rect" coords="84,19,134,43" alt="">
<area href="classlog4cxx_1_1helpers_1_1ObjectImpl.html" shape="rect" coords="126,93,201,117" alt="">
</map>
<center><font size="2">[<a href="graph_legend.html">legend</a>]</font></center>Collaboration diagram for XMLLayout:<p><center><img src="classlog4cxx_1_1xml_1_1XMLLayout__coll__graph.png" border="0" usemap="#XMLLayout__coll__map" alt="Collaboration graph"></center>
<map name="XMLLayout__coll__map">
<area href="classlog4cxx_1_1Layout.html" shape="rect" coords="84,168,134,192" alt="">
<area href="classlog4cxx_1_1spi_1_1OptionHandler.html" shape="rect" coords="6,93,102,117" alt="">
<area href="classlog4cxx_1_1helpers_1_1Object.html" shape="rect" coords="84,19,134,43" alt="">
<area href="classlog4cxx_1_1helpers_1_1ObjectImpl.html" shape="rect" coords="126,93,201,117" alt="">
</map>
<center><font size="2">[<a href="graph_legend.html">legend</a>]</font></center><a href="classlog4cxx_1_1xml_1_1XMLLayout-members.html">List of all members.</a><table border=0 cellpadding=0 cellspacing=0>
<tr><td></td></tr>
<tr><td colspan=2><br><h2>Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="classlog4cxx_1_1xml_1_1XMLLayout.html#a1">setLocationInfo</a> (bool locationInfo)</td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>bool&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="classlog4cxx_1_1xml_1_1XMLLayout.html#a2">getLocationInfo</a> () const </td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="classlog4cxx_1_1xml_1_1XMLLayout.html#a3">activateOptions</a> ()</td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>virtual void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="classlog4cxx_1_1xml_1_1XMLLayout.html#a4">setOption</a> (const String &amp;option, const String &amp;value)</td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>virtual void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="classlog4cxx_1_1xml_1_1XMLLayout.html#a5">format</a> (ostream &amp;output, const <a class="el" href="classlog4cxx_1_1helpers_1_1ObjectPtrT.html">spi::LoggingEventPtr</a> &amp;event) const </td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>virtual bool&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="classlog4cxx_1_1xml_1_1XMLLayout.html#a6">ignoresThrowable</a> () const </td></tr>
</table>
<hr><a name="_details"></a><h2>Detailed Description</h2>
The output of the <a class="el" href="classlog4cxx_1_1xml_1_1XMLLayout.html">XMLLayout</a> consists of a series of log4j:event elements as defined in the log4j.dtd. It does not output a complete well-formed XML file. The output is designed to be included as an <em>external entity</em> in a separate file to form a correct XML file.<p>
For example, if <code>abc</code> is the name of the file where the <a class="el" href="classlog4cxx_1_1xml_1_1XMLLayout.html">XMLLayout</a> ouput goes, then a well-formed XML file would be:<p>
<code> &lt;?xml version="1.0" ?&gt;</code><p>
<code> &lt;!DOCTYPE log4j:eventSet SYSTEM "log4j.dtd" [&lt;!ENTITY data SYSTEM "abc"&gt;]&gt;</code><p>
<code> &lt;log4j:eventSet version="1.2" xmlns:log4j="http://jakarta.apache.org/log4j/"&gt;</code><p>
<code> &amp;data;</code><p>
<code> &lt;/log4j:eventSet&gt; </code><p>
This approach enforces the independence of the <a class="el" href="classlog4cxx_1_1xml_1_1XMLLayout.html">XMLLayout</a> and the appender where it is embedded.
<p>
<hr><h2>Member Function Documentation</h2>
<a class="anchor" name="a3" doxytag="log4cxx::xml::XMLLayout::activateOptions" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> void activateOptions </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top">&nbsp;)&nbsp;</td>
<td class="md" nowrap><code> [inline, virtual]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
No options to activate.
<p>
Implements <a class="el" href="classlog4cxx_1_1spi_1_1OptionHandler.html#a1">OptionHandler</a>. </td>
</tr>
</table>
<a class="anchor" name="a5" doxytag="log4cxx::xml::XMLLayout::format" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> void format </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">ostream &amp;&nbsp;</td>
<td class="mdname" nowrap> <em>output</em>, </td>
</tr>
<tr>
<td></td>
<td></td>
<td class="md" nowrap>const <a class="el" href="classlog4cxx_1_1helpers_1_1ObjectPtrT.html">spi::LoggingEventPtr</a> &amp;&nbsp;</td>
<td class="mdname" nowrap> <em>event</em></td>
</tr>
<tr>
<td></td>
<td class="md">)&nbsp;</td>
<td class="md" colspan="2"> const<code> [virtual]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Formats a <a class="el" href="classlog4cxx_1_1spi_1_1LoggingEvent.html">LoggingEvent</a> in conformance with the log4cxx.dtd.
<p>
Normally a sort isn't required, but for Test Case purposes we need to guarantee a particular order.<p>
Besides which, from a human readable point of view, the sorting of the keys is kinda nice..
<p>
Implements <a class="el" href="classlog4cxx_1_1Layout.html#a1">Layout</a>. </td>
</tr>
</table>
<a class="anchor" name="a2" doxytag="log4cxx::xml::XMLLayout::getLocationInfo" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> bool getLocationInfo </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top">&nbsp;)&nbsp;</td>
<td class="md" nowrap> const<code> [inline]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Returns the current value of the <b>LocationInfo</b> option. </td>
</tr>
</table>
<a class="anchor" name="a6" doxytag="log4cxx::xml::XMLLayout::ignoresThrowable" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> virtual bool ignoresThrowable </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top">&nbsp;)&nbsp;</td>
<td class="md" nowrap> const<code> [inline, virtual]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
The <a class="el" href="classlog4cxx_1_1xml_1_1XMLLayout.html">XMLLayout</a> prints and does not ignore exceptions. Hence the return value <code>false</code>.
<p>
Implements <a class="el" href="classlog4cxx_1_1Layout.html#a5">Layout</a>. </td>
</tr>
</table>
<a class="anchor" name="a1" doxytag="log4cxx::xml::XMLLayout::setLocationInfo" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> void setLocationInfo </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">bool&nbsp;</td>
<td class="mdname1" valign="top" nowrap> <em>locationInfo</em> </td>
<td class="md" valign="top">&nbsp;)&nbsp;</td>
<td class="md" nowrap><code> [inline]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
The <b>LocationInfo</b> option takes a boolean value. By default, it is set to false which means there will be no location information output by this layout. If the the option is set to true, then the file name and line number of the statement at the origin of the log statement will be output.<p>
If you are embedding this layout within a SMTPAppender then make sure to set the <b>LocationInfo</b> option of that appender as well. </td>
</tr>
</table>
<a class="anchor" name="a4" doxytag="log4cxx::xml::XMLLayout::setOption" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> void setOption </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">const String &amp;&nbsp;</td>
<td class="mdname" nowrap> <em>option</em>, </td>
</tr>
<tr>
<td></td>
<td></td>
<td class="md" nowrap>const String &amp;&nbsp;</td>
<td class="mdname" nowrap> <em>value</em></td>
</tr>
<tr>
<td></td>
<td class="md">)&nbsp;</td>
<td class="md" colspan="2"><code> [virtual]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Set options
<p>
Implements <a class="el" href="classlog4cxx_1_1spi_1_1OptionHandler.html#a2">OptionHandler</a>. </td>
</tr>
</table>
<hr>The documentation for this class was generated from the following files:<ul>
<li>xmllayout.h<li>xmllayout.cpp</ul>
</td>
</tr>
<!-- FOOTER -->
<tr><td colspan="2">
<hr noshade="" size="1"/>
</td></tr>
<tr><td colspan="2">
<div align="center"><font color="#525D76" size="-1"><em>
Copyright &#169; 1999-2004, Apache Software Foundation
</em></font></div>
</td></tr>
</table>
<!-- END main table -->
</body>
</html>
<!-- end the processing -->