blob: f4e651c692a1e1b6d1346c335627ac742413bb20 [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>SocketAppender Class Reference</h1>Inheritance diagram for SocketAppender:<p><center><img src="classlog4cxx_1_1net_1_1SocketAppender__inherit__graph.png" border="0" usemap="#SocketAppender__inherit__map" alt="Inheritance graph"></center>
<map name="SocketAppender__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 SocketAppender:<p><center><img src="classlog4cxx_1_1net_1_1SocketAppender__coll__graph.png" border="0" usemap="#SocketAppender__coll__map" alt="Collaboration graph"></center>
<map name="SocketAppender__coll__map">
<area href="classlog4cxx_1_1AppenderSkeleton.html" shape="rect" coords="90,348,213,372" 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="6,96,102,120" alt="">
<area href="classlog4cxx_1_1helpers_1_1Object.html" shape="rect" coords="80,19,130,43" alt="">
<area href="classlog4cxx_1_1helpers_1_1ObjectImpl.html" shape="rect" coords="100,147,174,171" alt="">
<area href="classlog4cxx_1_1helpers_1_1ObjectPtrT.html" shape="rect" coords="217,197,289,221" alt="">
</map>
<center><font size="2">[<a href="graph_legend.html">legend</a>]</font></center><a href="classlog4cxx_1_1net_1_1SocketAppender-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>&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="classlog4cxx_1_1net_1_1SocketAppender.html#a2">SocketAppender</a> (unsigned long <a class="el" href="classlog4cxx_1_1net_1_1SocketAppender.html#p1">address</a>, int port)</td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="classlog4cxx_1_1net_1_1SocketAppender.html#a3">SocketAppender</a> (const String &amp;host, int port)</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_1SocketAppender.html#a4">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_1net_1_1SocketAppender.html#a5">setOption</a> (const String &amp;option, const String &amp;value)</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_1SocketAppender.html#a6">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_1SocketAppender.html#a7">cleanUp</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_1net_1_1SocketAppender.html#a9">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>bool&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="classlog4cxx_1_1net_1_1SocketAppender.html#a10">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_1SocketAppender.html#a11">setRemoteHost</a> (const String &amp;host)</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_1SocketAppender.html#a12">getRemoteHost</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_1SocketAppender.html#a13">setPort</a> (int port)</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_1SocketAppender.html#a14">getPort</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_1SocketAppender.html#a15">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_1net_1_1SocketAppender.html#a16">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_1net_1_1SocketAppender.html#a17">setReconnectionDelay</a> (int reconnectionDelay)</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_1SocketAppender.html#a18">getReconnectionDelay</a> () const </td></tr>
<tr><td colspan=2><br><h2>Static Public Attributes</h2></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_1SocketAppender.html#s0">DEFAULT_PORT</a> = 4560</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_1SocketAppender.html#s1">DEFAULT_RECONNECTION_DELAY</a> = 30000</td></tr>
<tr><td colspan=2><br><h2>Protected Attributes</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_1SocketAppender.html#p0">remoteHost</a></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>helpers::InetAddress&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="classlog4cxx_1_1net_1_1SocketAppender.html#p1">address</a></td></tr>
</table>
<hr><a name="_details"></a><h2>Detailed Description</h2>
Sends <a class="el" href="classlog4cxx_1_1spi_1_1LoggingEvent.html">LoggingEvent</a> objects to a remote a log server, usually a <a class="el" href="classlog4cxx_1_1net_1_1SocketNode.html">SocketNode</a>.<p>
The <a class="el" href="classlog4cxx_1_1net_1_1SocketAppender.html">SocketAppender</a> has the following properties:<p>
<ul>
<li>If sent to a <a class="el" href="classlog4cxx_1_1net_1_1SocketNode.html">SocketNode</a>, remote logging is non-intrusive as far as the log event is concerned. In other words, the event will be logged with the same time stamp, <a class="el" href="classlog4cxx_1_1NDC.html">NDC</a>, location info as if it were logged locally by the client.</li></ul>
<p>
<ul>
<li>SocketAppenders do not use a layout. They ship a serialized <a class="el" href="classlog4cxx_1_1spi_1_1LoggingEvent.html">LoggingEvent</a> object to the server side.</li></ul>
<p>
<ul>
<li>Remote logging uses the TCP protocol. Consequently, if the server is reachable, then log events will eventually arrive at the server.</li></ul>
<p>
<ul>
<li>If the remote server is down, the logging requests are simply dropped. However, if and when the server comes back up, then event transmission is resumed transparently. This transparent reconneciton is performed by a <em>connector</em> thread which periodically attempts to connect to the server.</li></ul>
<p>
<ul>
<li>Logging events are automatically <em>buffered</em> by the native TCP implementation. This means that if the link to server is slow but still faster than the rate of (log) event production by the client, the client will not be affected by the slow network connection. However, if the network connection is slower then the rate of event production, then the client can only progress at the network rate. In particular, if the network link to the the server is down, the client will be blocked. <br>
<br>
On the other hand, if the network link is up, but the server is down, the client will not be blocked when making log requests but the log events will be lost due to server unavailability.</li></ul>
<p>
<ul>
<li>Even if a <code><a class="el" href="classlog4cxx_1_1net_1_1SocketAppender.html">SocketAppender</a></code> is no longer attached to any logger, it will not be destroyed in the presence of a connector thread. A connector thread exists only if the connection to the server is down. To avoid this destruction problem, you should <a class="el" href="classlog4cxx_1_1net_1_1SocketAppender.html#a6">close</a> the the <code><a class="el" href="classlog4cxx_1_1net_1_1SocketAppender.html">SocketAppender</a></code> explicitly. See also next item. <br>
<br>
Long lived applications which create/destroy many <code><a class="el" href="classlog4cxx_1_1net_1_1SocketAppender.html">SocketAppender</a></code> instances should be aware of this destruction problem. Most other applications can safely ignore it.</li></ul>
<p>
<ul>
<li>If the application hosting the <code><a class="el" href="classlog4cxx_1_1net_1_1SocketAppender.html">SocketAppender</a></code> exits before the <code><a class="el" href="classlog4cxx_1_1net_1_1SocketAppender.html">SocketAppender</a></code> is closed either explicitly or subsequent to destruction, then there might be untransmitted data in the pipe which might be lost. <br>
<br>
To avoid lost data, it is usually sufficient to <a class="el" href="classlog4cxx_1_1net_1_1SocketAppender.html#a6">close</a> the <code><a class="el" href="classlog4cxx_1_1net_1_1SocketAppender.html">SocketAppender</a></code> either explicitly or by calling the <a class="el" href="classlog4cxx_1_1LogManager.html#e7">LogManager::shutdown</a> method before exiting the application. </li></ul>
<p>
<hr><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" name="a2" doxytag="log4cxx::net::SocketAppender::SocketAppender" ></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"> <a class="el" href="classlog4cxx_1_1net_1_1SocketAppender.html">SocketAppender</a> </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">unsigned long&nbsp;</td>
<td class="mdname" nowrap> <em>address</em>, </td>
</tr>
<tr>
<td></td>
<td></td>
<td class="md" nowrap>int&nbsp;</td>
<td class="mdname" nowrap> <em>port</em></td>
</tr>
<tr>
<td></td>
<td class="md">)&nbsp;</td>
<td class="md" colspan="2"></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Connects to remote server at <code>address</code> and <code>port</code>. </td>
</tr>
</table>
<a class="anchor" name="a3" doxytag="log4cxx::net::SocketAppender::SocketAppender" ></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"> <a class="el" href="classlog4cxx_1_1net_1_1SocketAppender.html">SocketAppender</a> </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">const String &amp;&nbsp;</td>
<td class="mdname" nowrap> <em>host</em>, </td>
</tr>
<tr>
<td></td>
<td></td>
<td class="md" nowrap>int&nbsp;</td>
<td class="mdname" nowrap> <em>port</em></td>
</tr>
<tr>
<td></td>
<td class="md">)&nbsp;</td>
<td class="md" colspan="2"></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Connects to remote server at <code>host</code> and <code>port</code>. </td>
</tr>
</table>
<hr><h2>Member Function Documentation</h2>
<a class="anchor" name="a4" doxytag="log4cxx::net::SocketAppender::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>
Connect to the specified <b>RemoteHost</b> and <b>Port</b>.
<p>
Reimplemented from <a class="el" href="classlog4cxx_1_1AppenderSkeleton.html#a2">AppenderSkeleton</a>. </td>
</tr>
</table>
<a class="anchor" name="a9" doxytag="log4cxx::net::SocketAppender::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="a7" doxytag="log4cxx::net::SocketAppender::cleanUp" ></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 cleanUp </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></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Drop the connection to the remote host and release the underlying connector thread if it has been created </td>
</tr>
</table>
<a class="anchor" name="a6" doxytag="log4cxx::net::SocketAppender::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>
Close this appender.<p>
This will mark the appender as closed and call then <a class="el" href="classlog4cxx_1_1net_1_1SocketAppender.html#a7">cleanUp</a> method.
<p>
Implements <a class="el" href="classlog4cxx_1_1Appender.html#a4">Appender</a>. </td>
</tr>
</table>
<a class="anchor" name="a16" doxytag="log4cxx::net::SocketAppender::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 value of the <b>LocationInfo</b> option. </td>
</tr>
</table>
<a class="anchor" name="a14" doxytag="log4cxx::net::SocketAppender::getPort" ></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 getPort </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 value of the <b>Port</b> option. </td>
</tr>
</table>
<a class="anchor" name="a18" doxytag="log4cxx::net::SocketAppender::getReconnectionDelay" ></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 getReconnectionDelay </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 value of the <b>ReconnectionDelay</b> option. </td>
</tr>
</table>
<a class="anchor" name="a12" doxytag="log4cxx::net::SocketAppender::getRemoteHost" ></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; getRemoteHost </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 value of the <b>RemoteHost</b> option. </td>
</tr>
</table>
<a class="anchor" name="a10" doxytag="log4cxx::net::SocketAppender::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"> 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_1SocketAppender.html">SocketAppender</a> does not use a layout. Hence, this method returns <code>false</code>.
<p>
Implements <a class="el" href="classlog4cxx_1_1Appender.html#a12">Appender</a>. </td>
</tr>
</table>
<a class="anchor" name="a15" doxytag="log4cxx::net::SocketAppender::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. If true, the information sent to the remote host will include location information. By default no location information is sent to the server. </td>
</tr>
</table>
<a class="anchor" name="a5" doxytag="log4cxx::net::SocketAppender::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>
Reimplemented from <a class="el" href="classlog4cxx_1_1AppenderSkeleton.html#a3">AppenderSkeleton</a>. </td>
</tr>
</table>
<a class="anchor" name="a13" doxytag="log4cxx::net::SocketAppender::setPort" ></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 setPort </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">int&nbsp;</td>
<td class="mdname1" valign="top" nowrap> <em>port</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>Port</b> option takes a positive integer representing the port where the server is waiting for connections. </td>
</tr>
</table>
<a class="anchor" name="a17" doxytag="log4cxx::net::SocketAppender::setReconnectionDelay" ></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 setReconnectionDelay </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">int&nbsp;</td>
<td class="mdname1" valign="top" nowrap> <em>reconnectionDelay</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>ReconnectionDelay</b> option takes a positive integer representing the number of milliseconds to wait between each failed connection attempt to the server. The default value of this option is 30000 which corresponds to 30 seconds.<p>
Setting this option to zero turns off reconnection capability. </td>
</tr>
</table>
<a class="anchor" name="a11" doxytag="log4cxx::net::SocketAppender::setRemoteHost" ></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 setRemoteHost </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>host</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>RemoteHost</b> option takes a string value which should be the host name of the server where a <a class="el" href="classlog4cxx_1_1net_1_1SocketNode.html">SocketNode</a> is running. </td>
</tr>
</table>
<hr><h2>Member Data Documentation</h2>
<a class="anchor" name="p1" doxytag="log4cxx::net::SocketAppender::address" ></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"> helpers::InetAddress <a class="el" href="classlog4cxx_1_1net_1_1SocketAppender.html#p1">address</a><code> [protected]</code>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
IP address </td>
</tr>
</table>
<a class="anchor" name="s0" doxytag="log4cxx::net::SocketAppender::DEFAULT_PORT" ></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 <a class="el" href="classlog4cxx_1_1net_1_1SocketAppender.html#s0">DEFAULT_PORT</a> = 4560<code> [static]</code>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
The default port number of remote logging server (4560). </td>
</tr>
</table>
<a class="anchor" name="s1" doxytag="log4cxx::net::SocketAppender::DEFAULT_RECONNECTION_DELAY" ></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 <a class="el" href="classlog4cxx_1_1net_1_1SocketAppender.html#s1">DEFAULT_RECONNECTION_DELAY</a> = 30000<code> [static]</code>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
The default reconnection delay (30000 milliseconds or 30 seconds). </td>
</tr>
</table>
<a class="anchor" name="p0" doxytag="log4cxx::net::SocketAppender::remoteHost" ></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 <a class="el" href="classlog4cxx_1_1net_1_1SocketAppender.html#p0">remoteHost</a><code> [protected]</code>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
host name </td>
</tr>
</table>
<hr>The documentation for this class was generated from the following files:<ul>
<li>socketappender.h<li>socketappender.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 -->