blob: 05185ea6952a48232e25fb287da8d6a3f712e7e9 [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>SyslogAppender Class Reference</h1>Inheritance diagram for SyslogAppender:<p><center><img src="classlog4cxx_1_1net_1_1SyslogAppender__inherit__graph.png" border="0" usemap="#SyslogAppender__inherit__map" alt="Inheritance graph"></center>
<map name="SyslogAppender__inherit__map">
<area href="classlog4cxx_1_1AppenderSkeleton.html" shape="rect" coords="36,242,158,266" alt="">
<area href="classlog4cxx_1_1Appender.html" shape="rect" coords="13,168,85,191" 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="73,18,124,42" alt="">
<area href="classlog4cxx_1_1helpers_1_1ObjectImpl.html" shape="rect" coords="109,168,184,191" alt="">
</map>
<center><font size="2">[<a href="graph_legend.html">legend</a>]</font></center>Collaboration diagram for SyslogAppender:<p><center><img src="classlog4cxx_1_1net_1_1SyslogAppender__coll__graph.png" border="0" usemap="#SyslogAppender__coll__map" alt="Collaboration graph"></center>
<map name="SyslogAppender__coll__map">
<area href="classlog4cxx_1_1AppenderSkeleton.html" shape="rect" coords="83,346,205,370" alt="">
<area href="classlog4cxx_1_1Appender.html" shape="rect" coords="21,197,93,221" alt="">
<area href="classlog4cxx_1_1spi_1_1OptionHandler.html" shape="rect" coords="7,96,103,120" alt="">
<area href="classlog4cxx_1_1helpers_1_1Object.html" shape="rect" coords="80,18,131,42" alt="">
<area href="classlog4cxx_1_1helpers_1_1ObjectImpl.html" shape="rect" coords="100,146,175,170" alt="">
<area href="classlog4cxx_1_1helpers_1_1ObjectPtrT.html" shape="rect" coords="222,197,294,221" alt="">
<area href="classlog4cxx_1_1helpers_1_1SyslogWriter.html" shape="rect" coords="257,346,342,370" alt="">
</map>
<center><font size="2">[<a href="graph_legend.html">legend</a>]</font></center><a href="classlog4cxx_1_1net_1_1SyslogAppender-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_1net_1_1SyslogAppender.html#a4">close</a> ()</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_1net_1_1SyslogAppender.html#a5">append</a> (const <a class="el" href="classlog4cxx_1_1helpers_1_1ObjectPtrT.html">spi::LoggingEventPtr</a> &amp;event)</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_1net_1_1SyslogAppender.html#a6">activateOptions</a> ()</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_1net_1_1SyslogAppender.html#a7">setOption</a> (const String &amp;option, const String &amp;value)</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_1net_1_1SyslogAppender.html#a8">requiresLayout</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_1net_1_1SyslogAppender.html#a9">setSyslogHost</a> (const String &amp;syslogHost)</td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>const String &amp;&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="classlog4cxx_1_1net_1_1SyslogAppender.html#a10">getSyslogHost</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_1net_1_1SyslogAppender.html#a11">setFacility</a> (const String &amp;facilityName)</td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>String&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="classlog4cxx_1_1net_1_1SyslogAppender.html#a12">getFacility</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_1net_1_1SyslogAppender.html#a13">setFacilityPrinting</a> (bool facilityPrinting)</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_1net_1_1SyslogAppender.html#a14">getFacilityPrinting</a> () const </td></tr>
<tr><td colspan=2><br><h2>Static Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>String&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="classlog4cxx_1_1net_1_1SyslogAppender.html#e0">getFacilityString</a> (int syslogFacility)</td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>int&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="classlog4cxx_1_1net_1_1SyslogAppender.html#e1">getFacility</a> (const String &amp;facilityName)</td></tr>
</table>
<hr><a name="_details"></a><h2>Detailed Description</h2>
Use <a class="el" href="classlog4cxx_1_1net_1_1SyslogAppender.html">SyslogAppender</a> to send log messages to a remote syslog daemon.
<p>
<hr><h2>Member Function Documentation</h2>
<a class="anchor" name="a6" doxytag="log4cxx::net::SyslogAppender::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> [virtual]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
This method returns immediately as options are activated when they are set.
<p>
Reimplemented from <a class="el" href="classlog4cxx_1_1AppenderSkeleton.html#a2">AppenderSkeleton</a>. </td>
</tr>
</table>
<a class="anchor" name="a5" doxytag="log4cxx::net::SyslogAppender::append" ></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 append </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">const <a class="el" href="classlog4cxx_1_1helpers_1_1ObjectPtrT.html">spi::LoggingEventPtr</a> &amp;&nbsp;</td>
<td class="mdname1" valign="top" nowrap> <em>event</em> </td>
<td class="md" valign="top">&nbsp;)&nbsp;</td>
<td class="md" nowrap><code> [virtual]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Subclasses of <code><a class="el" href="classlog4cxx_1_1AppenderSkeleton.html">AppenderSkeleton</a></code> should implement this method to perform actual logging. See also <a class="el" href="classlog4cxx_1_1AppenderSkeleton.html#a13">AppenderSkeleton::doAppend</a> method.
<p>
Implements <a class="el" href="classlog4cxx_1_1AppenderSkeleton.html#b0">AppenderSkeleton</a>. </td>
</tr>
</table>
<a class="anchor" name="a4" doxytag="log4cxx::net::SyslogAppender::close" ></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 close </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> [virtual]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Release any resources held by this <a class="el" href="classlog4cxx_1_1net_1_1SyslogAppender.html">SyslogAppender</a>.
<p>
Implements <a class="el" href="classlog4cxx_1_1Appender.html#a4">Appender</a>. </td>
</tr>
</table>
<a class="anchor" name="a12" doxytag="log4cxx::net::SyslogAppender::getFacility" ></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"> String getFacility </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 value of the <b>Facility</b> option. </td>
</tr>
</table>
<a class="anchor" name="e1" doxytag="log4cxx::net::SyslogAppender::getFacility" ></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"> int getFacility </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">const String &amp;&nbsp;</td>
<td class="mdname1" valign="top" nowrap> <em>facilityName</em> </td>
<td class="md" valign="top">&nbsp;)&nbsp;</td>
<td class="md" nowrap><code> [static]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Returns the integer value corresponding to the named syslog facility, or -1 if it couldn't be recognized. <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign=top><em>facilityName</em>&nbsp;</td><td>one of the strings KERN, USER, MAIL, DAEMON, AUTH, SYSLOG, LPR, NEWS, UUCP, CRON, AUTHPRIV, FTP, LOCAL0, LOCAL1, LOCAL2, LOCAL3, LOCAL4, LOCAL5, LOCAL6, LOCAL7. The matching is case-insensitive.</td></tr>
</table>
</dl>
</td>
</tr>
</table>
<a class="anchor" name="a14" doxytag="log4cxx::net::SyslogAppender::getFacilityPrinting" ></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 getFacilityPrinting </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 value of the <b>FacilityPrinting</b> option. </td>
</tr>
</table>
<a class="anchor" name="e0" doxytag="log4cxx::net::SyslogAppender::getFacilityString" ></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"> String getFacilityString </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">int&nbsp;</td>
<td class="mdname1" valign="top" nowrap> <em>syslogFacility</em> </td>
<td class="md" valign="top">&nbsp;)&nbsp;</td>
<td class="md" nowrap><code> [static]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Returns the specified syslog facility as a lower-case String, e.g. "kern", "user", etc. </td>
</tr>
</table>
<a class="anchor" name="a10" doxytag="log4cxx::net::SyslogAppender::getSyslogHost" ></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"> const String&amp; getSyslogHost </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 value of the <b>SyslogHost</b> option. </td>
</tr>
</table>
<a class="anchor" name="a8" doxytag="log4cxx::net::SyslogAppender::requiresLayout" ></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 requiresLayout </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_1net_1_1SyslogAppender.html">SyslogAppender</a> requires a layout. Hence, this method returns <code>true</code>.
<p>
Implements <a class="el" href="classlog4cxx_1_1Appender.html#a12">Appender</a>. </td>
</tr>
</table>
<a class="anchor" name="a11" doxytag="log4cxx::net::SyslogAppender::setFacility" ></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 setFacility </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">const String &amp;&nbsp;</td>
<td class="mdname1" valign="top" nowrap> <em>facilityName</em> </td>
<td class="md" valign="top">&nbsp;)&nbsp;</td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Set the syslog facility. This is the <b>Facility</b> option.<p>
The <code>facilityName</code> parameter must be one of the strings KERN, USER, MAIL, DAEMON, AUTH, SYSLOG, LPR, NEWS, UUCP, CRON, AUTHPRIV, FTP, LOCAL0, LOCAL1, LOCAL2, LOCAL3, LOCAL4, LOCAL5, LOCAL6, LOCAL7. Case is unimportant. </td>
</tr>
</table>
<a class="anchor" name="a13" doxytag="log4cxx::net::SyslogAppender::setFacilityPrinting" ></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 setFacilityPrinting </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">bool&nbsp;</td>
<td class="mdname1" valign="top" nowrap> <em>facilityPrinting</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>
If the <b>FacilityPrinting</b> option is set to true, the printed message will include the facility name of the application. It is <em>false</em> by default. </td>
</tr>
</table>
<a class="anchor" name="a7" doxytag="log4cxx::net::SyslogAppender::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 <code>option</code> to <code>value</code>.<p>
The handling of each option depends on the OptionHandler instance. Some options may become active immediately whereas other may be activated only when <a class="el" href="classlog4cxx_1_1net_1_1SyslogAppender.html#a6">activateOptions</a> is called.
<p>
Reimplemented from <a class="el" href="classlog4cxx_1_1AppenderSkeleton.html#a3">AppenderSkeleton</a>. </td>
</tr>
</table>
<a class="anchor" name="a9" doxytag="log4cxx::net::SyslogAppender::setSyslogHost" ></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 setSyslogHost </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">const String &amp;&nbsp;</td>
<td class="mdname1" valign="top" nowrap> <em>syslogHost</em> </td>
<td class="md" valign="top">&nbsp;)&nbsp;</td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
The <b>SyslogHost</b> option is the name of the the syslog host where log output should go. <b>WARNING</b> If the SyslogHost is not set, then this appender will fail. </td>
</tr>
</table>
<hr>The documentation for this class was generated from the following files:<ul>
<li>syslogappender.h<li>syslogappender.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 -->