File: classlog4cpp_1_1SyslogAppender.html

package info (click to toggle)
log4cpp-doc 1.0-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 8,528 kB
  • sloc: makefile: 10
file content (297 lines) | stat: -rw-r--r-- 18,594 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>log4cpp: log4cpp::SyslogAppender Class Reference</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
<link href="tabs.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.5.2 -->
<div class="tabs">
  <ul>
    <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
    <li><a href="namespaces.html"><span>Namespaces</span></a></li>
    <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
    <li><a href="files.html"><span>Files</span></a></li>
    <li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
  </ul>
</div>
<div class="tabs">
  <ul>
    <li><a href="annotated.html"><span>Class&nbsp;List</span></a></li>
    <li><a href="hierarchy.html"><span>Class&nbsp;Hierarchy</span></a></li>
    <li><a href="functions.html"><span>Class&nbsp;Members</span></a></li>
  </ul>
</div>
<div class="nav">
<a class="el" href="namespacelog4cpp.html">log4cpp</a>::<a class="el" href="classlog4cpp_1_1SyslogAppender.html">SyslogAppender</a></div>
<h1>log4cpp::SyslogAppender Class Reference</h1><!-- doxytag: class="log4cpp::SyslogAppender" --><!-- doxytag: inherits="log4cpp::LayoutAppender" --><a class="el" href="classlog4cpp_1_1SyslogAppender.html" title="SyslogAppender sends LoggingEvents to the local syslog system.">SyslogAppender</a> sends LoggingEvents to the local syslog system.  
<a href="#_details">More...</a>
<p>
<code>#include &lt;<a class="el" href="SyslogAppender_8hh-source.html">SyslogAppender.hh</a>&gt;</code>
<p>
Inheritance diagram for log4cpp::SyslogAppender:<p><center><img src="classlog4cpp_1_1SyslogAppender__inherit__graph.gif" border="0" usemap="#log4cpp_1_1SyslogAppender__inherit__map" alt="Inheritance graph"></center>
<map name="log4cpp_1_1SyslogAppender__inherit__map">
<area shape="rect" href="classlog4cpp_1_1LayoutAppender.html" title="LayoutAppender is a common superclass for all Appenders that require a Layout." alt="" coords="9,155,172,181"><area shape="rect" href="classlog4cpp_1_1AppenderSkeleton.html" title="AppenderSkeleton is a helper class, simplifying implementation of Appenders: it already..." alt="" coords="5,80,176,107"><area shape="rect" href="classlog4cpp_1_1Appender.html" title="Implement this interface for your own strategies for printing log statements." alt="" coords="29,5,152,32"></map>
<center><font size="2">[<a href="graph_legend.html">legend</a>]</font></center>Collaboration diagram for log4cpp::SyslogAppender:<p><center><img src="classlog4cpp_1_1SyslogAppender__coll__graph.gif" border="0" usemap="#log4cpp_1_1SyslogAppender__coll__map" alt="Collaboration graph"></center>
<map name="log4cpp_1_1SyslogAppender__coll__map">
<area shape="rect" href="classlog4cpp_1_1LayoutAppender.html" title="LayoutAppender is a common superclass for all Appenders that require a Layout." alt="" coords="172,277,335,304"><area shape="rect" href="classlog4cpp_1_1AppenderSkeleton.html" title="AppenderSkeleton is a helper class, simplifying implementation of Appenders: it already..." alt="" coords="45,187,216,213"><area shape="rect" href="classlog4cpp_1_1Appender.html" title="Implement this interface for your own strategies for printing log statements." alt="" coords="25,96,148,123"><area shape="rect" href="classlog4cpp_1_1threading_1_1Mutex.html" title="log4cpp::threading::Mutex" alt="" coords="5,5,168,32"><area shape="rect" title="_appenderMapMutex" alt="" coords="83,28,91,36"><area shape="rect" title="_appenderMapMutex" alt="" coords="83,92,91,100"><area shape="rect" href="classlog4cpp_1_1Filter.html" title="Users should extend this class to implement customized logging event filtering." alt="" coords="172,96,271,123"><area shape="rect" title="_filter" alt="" coords="204,119,212,127"><area shape="rect" title="_filter" alt="" coords="140,183,148,191"><area shape="rect" title="_chainedFilter" alt="" coords="241,92,249,100"><area shape="rect" title="_chainedFilter" alt="" coords="241,119,249,127"><area shape="rect" href="classlog4cpp_1_1Layout.html" title="Extend this abstract class to create your own log layout format." alt="" coords="240,187,349,213"><area shape="rect" title="_layout" alt="" coords="284,209,292,217"><area shape="rect" title="_layout" alt="" coords="256,273,264,281"></map>
<center><font size="2">[<a href="graph_legend.html">legend</a>]</font></center><a href="classlog4cpp_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">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classlog4cpp_1_1SyslogAppender.html#3dedc5cdf1dc8321649b0e58dd1d07b7">SyslogAppender</a> (const std::string &amp;name, const std::string &amp;syslogName, int facility=LOG_USER)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Instantiate a <a class="el" href="classlog4cpp_1_1SyslogAppender.html" title="SyslogAppender sends LoggingEvents to the local syslog system.">SyslogAppender</a> with given name and name and facility for syslog.  <a href="#3dedc5cdf1dc8321649b0e58dd1d07b7"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classlog4cpp_1_1SyslogAppender.html#f1aef1edf10596dc2ab3e9cb14a2e6cb">~SyslogAppender</a> ()</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual bool&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classlog4cpp_1_1SyslogAppender.html#85b701a0503050eabd5cca763bbf0b0c">reopen</a> ()</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Calls closelog(3) and openlog(3).  <a href="#85b701a0503050eabd5cca763bbf0b0c"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classlog4cpp_1_1SyslogAppender.html#add9fc06a928ae8f25a935217dda3aac">close</a> ()</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Calls closelog(3) to close the syslog file descriptor.  <a href="#add9fc06a928ae8f25a935217dda3aac"></a><br></td></tr>
<tr><td colspan="2"><br><h2>Static Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">static int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classlog4cpp_1_1SyslogAppender.html#8e3264b37ebf7063cfba12b20418595d">toSyslogPriority</a> (<a class="el" href="classlog4cpp_1_1Priority.html#19c2e47a94a531d3028f7c545671ff72">Priority::Value</a> priority)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Translates a <a class="el" href="namespacelog4cpp.html" title="The top level namespace for all 'Log for C++' types and classes.">log4cpp</a> priority to a syslog priority.  <a href="#8e3264b37ebf7063cfba12b20418595d"></a><br></td></tr>
<tr><td colspan="2"><br><h2>Protected Member Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classlog4cpp_1_1SyslogAppender.html#f88b6d06d8b864da3ddd41a15a99e8ba">open</a> ()</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Calls openlog(3).  <a href="#f88b6d06d8b864da3ddd41a15a99e8ba"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classlog4cpp_1_1SyslogAppender.html#5a6d3f83e85c83f3105ad7829fe1d3c0">_append</a> (const <a class="el" href="structlog4cpp_1_1LoggingEvent.html">LoggingEvent</a> &amp;event)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Sends a <a class="el" href="structlog4cpp_1_1LoggingEvent.html" title="The internal representation of logging events.">LoggingEvent</a> to syslog.  <a href="#5a6d3f83e85c83f3105ad7829fe1d3c0"></a><br></td></tr>
<tr><td colspan="2"><br><h2>Protected Attributes</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">const std::string&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classlog4cpp_1_1SyslogAppender.html#cbff484f670bcd3be1fb3275ba164be1">_syslogName</a></td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classlog4cpp_1_1SyslogAppender.html#161acb9eb6afc9bcb939bab4d1e5f405">_facility</a></td></tr>

</table>
<hr><a name="_details"></a><h2>Detailed Description</h2>
<a class="el" href="classlog4cpp_1_1SyslogAppender.html" title="SyslogAppender sends LoggingEvents to the local syslog system.">SyslogAppender</a> sends LoggingEvents to the local syslog system. 
<p>
<hr><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" name="3dedc5cdf1dc8321649b0e58dd1d07b7"></a><!-- doxytag: member="log4cpp::SyslogAppender::SyslogAppender" ref="3dedc5cdf1dc8321649b0e58dd1d07b7" args="(const std::string &amp;name, const std::string &amp;syslogName, int facility=LOG_USER)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">log4cpp::SyslogAppender::SyslogAppender           </td>
          <td>(</td>
          <td class="paramtype">const std::string &amp;&nbsp;</td>
          <td class="paramname"> <em>name</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const std::string &amp;&nbsp;</td>
          <td class="paramname"> <em>syslogName</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>facility</em> = <code>LOG_USER</code></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td width="100%"></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Instantiate a <a class="el" href="classlog4cpp_1_1SyslogAppender.html" title="SyslogAppender sends LoggingEvents to the local syslog system.">SyslogAppender</a> with given name and name and facility for syslog. 
<p>
Note that the C syslog API is process global, so instantion of a second <a class="el" href="classlog4cpp_1_1SyslogAppender.html" title="SyslogAppender sends LoggingEvents to the local syslog system.">SyslogAppender</a> will 'overwrite' the syslog name of the first. <dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>name</em>&nbsp;</td><td>The name of the <a class="el" href="classlog4cpp_1_1Appender.html" title="Implement this interface for your own strategies for printing log statements.">Appender</a> </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>syslogName</em>&nbsp;</td><td>The ident parameter in the openlog(3) call. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>facility</em>&nbsp;</td><td>The syslog facility to log to. Defaults to LOG_USER. </td></tr>
  </table>
</dl>

</div>
</div><p>
<a class="anchor" name="f1aef1edf10596dc2ab3e9cb14a2e6cb"></a><!-- doxytag: member="log4cpp::SyslogAppender::~SyslogAppender" ref="f1aef1edf10596dc2ab3e9cb14a2e6cb" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">virtual log4cpp::SyslogAppender::~SyslogAppender           </td>
          <td>(</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"><code> [virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>

</div>
</div><p>
<hr><h2>Member Function Documentation</h2>
<a class="anchor" name="8e3264b37ebf7063cfba12b20418595d"></a><!-- doxytag: member="log4cpp::SyslogAppender::toSyslogPriority" ref="8e3264b37ebf7063cfba12b20418595d" args="(Priority::Value priority)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">static int log4cpp::SyslogAppender::toSyslogPriority           </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classlog4cpp_1_1Priority.html#19c2e47a94a531d3028f7c545671ff72">Priority::Value</a>&nbsp;</td>
          <td class="paramname"> <em>priority</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"><code> [static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Translates a <a class="el" href="namespacelog4cpp.html" title="The top level namespace for all 'Log for C++' types and classes.">log4cpp</a> priority to a syslog priority. 
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>priority</em>&nbsp;</td><td>The <a class="el" href="namespacelog4cpp.html" title="The top level namespace for all 'Log for C++' types and classes.">log4cpp</a> priority. </td></tr>
  </table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>the syslog priority. </dd></dl>

</div>
</div><p>
<a class="anchor" name="85b701a0503050eabd5cca763bbf0b0c"></a><!-- doxytag: member="log4cpp::SyslogAppender::reopen" ref="85b701a0503050eabd5cca763bbf0b0c" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">virtual bool log4cpp::SyslogAppender::reopen           </td>
          <td>(</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"><code> [virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Calls closelog(3) and openlog(3). 
<p>

<p>
Reimplemented from <a class="el" href="classlog4cpp_1_1AppenderSkeleton.html#1f61281caac83409db298b681635e029">log4cpp::AppenderSkeleton</a>.
</div>
</div><p>
<a class="anchor" name="add9fc06a928ae8f25a935217dda3aac"></a><!-- doxytag: member="log4cpp::SyslogAppender::close" ref="add9fc06a928ae8f25a935217dda3aac" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">virtual void log4cpp::SyslogAppender::close           </td>
          <td>(</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"><code> [virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Calls closelog(3) to close the syslog file descriptor. 
<p>

<p>
Implements <a class="el" href="classlog4cpp_1_1AppenderSkeleton.html#c62f94c6692fd146fcf37455d3e73439">log4cpp::AppenderSkeleton</a>.
</div>
</div><p>
<a class="anchor" name="f88b6d06d8b864da3ddd41a15a99e8ba"></a><!-- doxytag: member="log4cpp::SyslogAppender::open" ref="f88b6d06d8b864da3ddd41a15a99e8ba" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">virtual void log4cpp::SyslogAppender::open           </td>
          <td>(</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"><code> [protected, virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Calls openlog(3). 
<p>

</div>
</div><p>
<a class="anchor" name="5a6d3f83e85c83f3105ad7829fe1d3c0"></a><!-- doxytag: member="log4cpp::SyslogAppender::_append" ref="5a6d3f83e85c83f3105ad7829fe1d3c0" args="(const LoggingEvent &amp;event)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">virtual void log4cpp::SyslogAppender::_append           </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="structlog4cpp_1_1LoggingEvent.html">LoggingEvent</a> &amp;&nbsp;</td>
          <td class="paramname"> <em>event</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"><code> [protected, virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Sends a <a class="el" href="structlog4cpp_1_1LoggingEvent.html" title="The internal representation of logging events.">LoggingEvent</a> to syslog. 
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>event</em>&nbsp;</td><td>the <a class="el" href="structlog4cpp_1_1LoggingEvent.html" title="The internal representation of logging events.">LoggingEvent</a> to log. </td></tr>
  </table>
</dl>

<p>
Implements <a class="el" href="classlog4cpp_1_1AppenderSkeleton.html#643fb2614192ea09b502a3feb27abe66">log4cpp::AppenderSkeleton</a>.
</div>
</div><p>
<hr><h2>Member Data Documentation</h2>
<a class="anchor" name="cbff484f670bcd3be1fb3275ba164be1"></a><!-- doxytag: member="log4cpp::SyslogAppender::_syslogName" ref="cbff484f670bcd3be1fb3275ba164be1" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">const std::string <a class="el" href="classlog4cpp_1_1SyslogAppender.html#cbff484f670bcd3be1fb3275ba164be1">log4cpp::SyslogAppender::_syslogName</a><code> [protected]</code>          </td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>

</div>
</div><p>
<a class="anchor" name="161acb9eb6afc9bcb939bab4d1e5f405"></a><!-- doxytag: member="log4cpp::SyslogAppender::_facility" ref="161acb9eb6afc9bcb939bab4d1e5f405" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int <a class="el" href="classlog4cpp_1_1SyslogAppender.html#161acb9eb6afc9bcb939bab4d1e5f405">log4cpp::SyslogAppender::_facility</a><code> [protected]</code>          </td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>

</div>
</div><p>
<hr>The documentation for this class was generated from the following file:<ul>
<li><a class="el" href="SyslogAppender_8hh-source.html">SyslogAppender.hh</a></ul>
<hr size="1"><address style="text-align: right;"><small>Generated on Mon Sep 3 11:55:07 2007 for log4cpp by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.2 </small></address>
</body>
</html>