File: classlog4cxx_1_1_daily_rolling_file_appender.html

package info (click to toggle)
log4cxx 0.10.0-4
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 17,028 kB
  • ctags: 6,434
  • sloc: cpp: 33,940; sh: 8,852; xml: 4,686; makefile: 508; java: 48
file content (336 lines) | stat: -rw-r--r-- 19,958 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
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<!--

 Licensed to the Apache Software Foundation (ASF) under one or more
 contributor license agreements.  See the NOTICE file distributed with
 this work for additional information regarding copyright ownership.
 The ASF licenses this file to You under the Apache License, Version 2.0
 (the "License"); you may not use this file except in compliance with
 the License.  You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

 Unless required by applicable law or agreed to in writing, software
 distributed under the License is distributed on an "AS IS" BASIS,
 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 See the License for the specific language governing permissions and
 limitations under the License.

--><html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>Apache log4cxx: DailyRollingFileAppender 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.4.6 -->
<div class="tabs">
  <ul>
    <li><a href="main.html"><span>Main&nbsp;Page</span></a></li>
    <li><a href="modules.html"><span>Modules</span></a></li>
    <li><a href="namespaces.html"><span>Namespaces</span></a></li>
    <li id="current"><a href="classes.html"><span>Classes</span></a></li>
    <li><a href="files.html"><span>Files</span></a></li>
  </ul></div>
<div class="tabs">
  <ul>
    <li><a href="classes.html"><span>Alphabetical&nbsp;List</span></a></li>
    <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="namespacelog4cxx.html">log4cxx</a>::<a class="el" href="classlog4cxx_1_1_daily_rolling_file_appender.html">DailyRollingFileAppender</a></div>
<h1>DailyRollingFileAppender Class Reference</h1><!-- doxytag: class="log4cxx::DailyRollingFileAppender" --><!-- doxytag: inherits="log4cxx::rolling::RollingFileAppenderSkeleton" -->Inherits <a class="el" href="classlog4cxx_1_1rolling_1_1_rolling_file_appender_skeleton.html">RollingFileAppenderSkeleton</a>.
<p>
<a href="classlog4cxx_1_1_daily_rolling_file_appender-members.html">List of all members.</a><hr><a name="_details"></a><h2>Detailed Description</h2>
<a class="el" href="classlog4cxx_1_1_daily_rolling_file_appender.html">DailyRollingFileAppender</a> extends <a class="el" href="classlog4cxx_1_1_file_appender.html">FileAppender</a> so that the underlying file is rolled over at a user chosen frequency. 
<p>
The rolling schedule is specified by the <b>DatePattern</b> option. This pattern should follow the <a class="el" href="classlog4cxx_1_1helpers_1_1_simple_date_format.html">SimpleDateFormat</a> conventions. In particular, you <em>must</em> escape literal text within a pair of single quotes. A formatted version of the date pattern is used as the suffix for the rolled file name.<p>
For example, if the <b><a class="el" href="classlog4cxx_1_1_file.html">File</a></b> option is set to <code>/foo/bar.log</code> and the <b>DatePattern</b> set to <code>'.'yyyy-MM-dd</code>, on 2001-02-16 at midnight, the logging file <code>/foo/bar.log</code> will be copied to <code>/foo/bar.log.2001-02-16</code> and logging for 2001-02-17 will continue in <code>/foo/bar.log</code> until it rolls over the next day.<p>
Is is possible to specify monthly, weekly, half-daily, daily, hourly, or minutely rollover schedules.<p>
<table border="1" cellpadding="2" cellspacing="3">
<tr>
<th>DatePattern </th><th>Rollover schedule </th><th>Example<p>
</th></tr>
<tr>
<td><code>'.'yyyy-MM</code> </td><td>Rollover at the beginning of each month<p>
</td><td>At midnight of May 31st, 2002 <code>/foo/bar.log</code> will be copied to <code>/foo/bar.log.2002-05</code>. Logging for the month of June will be output to <code>/foo/bar.log</code> until it is also rolled over the next month.<p>
</td></tr>
<tr>
<td><code>'.'yyyy-ww</code><p>
</td><td>Rollover at the first day of each week. The first day of the week depends on the locale.<p>
</td><td>Assuming the first day of the week is Sunday, on Saturday midnight, June 9th 2002, the file <em>/foo/bar.log</em> will be copied to <em>/foo/bar.log.2002-23</em>. Logging for the 24th week of 2002 will be output to <code>/foo/bar.log</code> until it is rolled over the next week.<p>
</td></tr>
<tr>
<td><code>'.'yyyy-MM-dd</code><p>
</td><td>Rollover at midnight each day.<p>
</td><td>At midnight, on March 8th, 2002, <code>/foo/bar.log</code> will be copied to <code>/foo/bar.log.2002-03-08</code>. Logging for the 9th day of March will be output to <code>/foo/bar.log</code> until it is rolled over the next day.<p>
</td></tr>
<tr>
<td><code>'.'yyyy-MM-dd-a</code><p>
</td><td>Rollover at midnight and midday of each day.<p>
</td><td>At noon, on March 9th, 2002, <code>/foo/bar.log</code> will be copied to <code>/foo/bar.log.2002-03-09-AM</code>. Logging for the afternoon of the 9th will be output to <code>/foo/bar.log</code> until it is rolled over at midnight.<p>
</td></tr>
<tr>
<td><code>'.'yyyy-MM-dd-HH</code><p>
</td><td>Rollover at the top of every hour.<p>
</td><td>At approximately 11:00.000 o'clock on March 9th, 2002, <code>/foo/bar.log</code> will be copied to <code>/foo/bar.log.2002-03-09-10</code>. Logging for the 11th hour of the 9th of March will be output to <code>/foo/bar.log</code> until it is rolled over at the beginning of the next hour.<p>
</td></tr>
<tr>
<td><code>'.'yyyy-MM-dd-HH-mm</code><p>
</td><td>Rollover at the beginning of every minute.<p>
</td><td>At approximately 11:23,000, on March 9th, 2001, <code>/foo/bar.log</code> will be copied to <code>/foo/bar.log.2001-03-09-10-22</code>. Logging for the minute of 11:23 (9th of March) will be output to <code>/foo/bar.log</code> until it is rolled over the next minute.<p>
</td></tr>
</table>
<p>
Do not use the colon ":" character in anywhere in the <b>DatePattern</b> option. The text before the colon is interpeted as the protocol specificaion of a URL which is probably not what you want. 
<p>
<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_1_daily_rolling_file_appender.html#d07e32d489f3a68035f22bb71432663c">DailyRollingFileAppender</a> ()</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The default constructor simply calls its <a class="el" href="classlog4cxx_1_1_file_appender.html#3d8fe210d6211cccc14aa2363753cffd">parents constructor</a>.  <a href="#d07e32d489f3a68035f22bb71432663c"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classlog4cxx_1_1_daily_rolling_file_appender.html#f35541dbb66191765c6769df0116f2bd">DailyRollingFileAppender</a> (const <a class="el" href="classlog4cxx_1_1helpers_1_1_object_ptr_t.html">LayoutPtr</a> &amp;<a class="el" href="classlog4cxx_1_1_appender_skeleton.html#f1f4e6a2229d95a18324c4e7fa71be65">layout</a>, const <a class="el" href="namespacelog4cxx.html#d7ec98d27bca7666e23f27dd1fb181c8">LogString</a> &amp;filename, const <a class="el" href="namespacelog4cxx.html#d7ec98d27bca7666e23f27dd1fb181c8">LogString</a> &amp;datePattern)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Instantiate a <a class="el" href="classlog4cxx_1_1_daily_rolling_file_appender.html">DailyRollingFileAppender</a> and open the file designated by <code>filename</code>.  <a href="#f35541dbb66191765c6769df0116f2bd"></a><br></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_1_daily_rolling_file_appender.html#f598ebf12a1b864b8945550eb71d7148">setDatePattern</a> (const <a class="el" href="namespacelog4cxx.html#d7ec98d27bca7666e23f27dd1fb181c8">LogString</a> &amp;pattern)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The <b>DatePattern</b> takes a string in the same format as expected by <a class="el" href="classlog4cxx_1_1helpers_1_1_simple_date_format.html">SimpleDateFormat</a>.  <a href="#f598ebf12a1b864b8945550eb71d7148"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="namespacelog4cxx.html#d7ec98d27bca7666e23f27dd1fb181c8">LogString</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classlog4cxx_1_1_daily_rolling_file_appender.html#30e63edb36ab51d054fe95c59d3f9300">getDatePattern</a> ()</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns the value of the <b>DatePattern</b> option.  <a href="#30e63edb36ab51d054fe95c59d3f9300"></a><br></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_1_daily_rolling_file_appender.html#c1d269357907e0809687a2bec962e1c8">setOption</a> (const <a class="el" href="namespacelog4cxx.html#d7ec98d27bca7666e23f27dd1fb181c8">LogString</a> &amp;option, const <a class="el" href="namespacelog4cxx.html#d7ec98d27bca7666e23f27dd1fb181c8">LogString</a> &amp;value)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Set <code>option</code> to <code>value</code>.  <a href="#c1d269357907e0809687a2bec962e1c8"></a><br></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_1_daily_rolling_file_appender.html#580abdcb8fd42d07eaf679166f77bc34">activateOptions</a> (<a class="el" href="classlog4cxx_1_1helpers_1_1_pool.html">log4cxx::helpers::Pool</a> &amp;)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Prepares <a class="el" href="classlog4cxx_1_1_daily_rolling_file_appender.html">DailyRollingFileAppender</a> for use.  <a href="#580abdcb8fd42d07eaf679166f77bc34"></a><br></td></tr>
</table>
<hr><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" name="d07e32d489f3a68035f22bb71432663c"></a><!-- doxytag: member="log4cxx::DailyRollingFileAppender::DailyRollingFileAppender" ref="d07e32d489f3a68035f22bb71432663c" args="()" --><p>
<table class="mdTable" 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_1_daily_rolling_file_appender.html">DailyRollingFileAppender</a>           </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>
The default constructor simply calls its <a class="el" href="classlog4cxx_1_1_file_appender.html#3d8fe210d6211cccc14aa2363753cffd">parents constructor</a>. 
<p>
    </td>
  </tr>
</table>
<a class="anchor" name="f35541dbb66191765c6769df0116f2bd"></a><!-- doxytag: member="log4cxx::DailyRollingFileAppender::DailyRollingFileAppender" ref="f35541dbb66191765c6769df0116f2bd" args="(const LayoutPtr &amp;layout, const LogString &amp;filename, const LogString &amp;datePattern)" --><p>
<table class="mdTable" 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_1_daily_rolling_file_appender.html">DailyRollingFileAppender</a>           </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">const <a class="el" href="classlog4cxx_1_1helpers_1_1_object_ptr_t.html">LayoutPtr</a> &amp;&nbsp;</td>
          <td class="mdname" nowrap> <em>layout</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap>const <a class="el" href="namespacelog4cxx.html#d7ec98d27bca7666e23f27dd1fb181c8">LogString</a> &amp;&nbsp;</td>
          <td class="mdname" nowrap> <em>filename</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap>const <a class="el" href="namespacelog4cxx.html#d7ec98d27bca7666e23f27dd1fb181c8">LogString</a> &amp;&nbsp;</td>
          <td class="mdname" nowrap> <em>datePattern</em></td>
        </tr>
        <tr>
          <td class="md"></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>
Instantiate a <a class="el" href="classlog4cxx_1_1_daily_rolling_file_appender.html">DailyRollingFileAppender</a> and open the file designated by <code>filename</code>. 
<p>
The opened filename will become the ouput destination for this appender.     </td>
  </tr>
</table>
<hr><h2>Member Function Documentation</h2>
<a class="anchor" name="580abdcb8fd42d07eaf679166f77bc34"></a><!-- doxytag: member="log4cxx::DailyRollingFileAppender::activateOptions" ref="580abdcb8fd42d07eaf679166f77bc34" args="(log4cxx::helpers::Pool &amp;)" --><p>
<table class="mdTable" 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="md" nowrap valign="top"><a class="el" href="classlog4cxx_1_1helpers_1_1_pool.html">log4cxx::helpers::Pool</a> &amp;&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>
Prepares <a class="el" href="classlog4cxx_1_1_daily_rolling_file_appender.html">DailyRollingFileAppender</a> for use. 
<p>

<p>
Reimplemented from <a class="el" href="classlog4cxx_1_1rolling_1_1_rolling_file_appender_skeleton.html#580abdcb8fd42d07eaf679166f77bc34">RollingFileAppenderSkeleton</a>.    </td>
  </tr>
</table>
<a class="anchor" name="30e63edb36ab51d054fe95c59d3f9300"></a><!-- doxytag: member="log4cxx::DailyRollingFileAppender::getDatePattern" ref="30e63edb36ab51d054fe95c59d3f9300" args="()" --><p>
<table class="mdTable" 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="namespacelog4cxx.html#d7ec98d27bca7666e23f27dd1fb181c8">LogString</a> getDatePattern           </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>
Returns the value of the <b>DatePattern</b> option. 
<p>
    </td>
  </tr>
</table>
<a class="anchor" name="f598ebf12a1b864b8945550eb71d7148"></a><!-- doxytag: member="log4cxx::DailyRollingFileAppender::setDatePattern" ref="f598ebf12a1b864b8945550eb71d7148" args="(const LogString &amp;pattern)" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top">void setDatePattern           </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">const <a class="el" href="namespacelog4cxx.html#d7ec98d27bca7666e23f27dd1fb181c8">LogString</a> &amp;&nbsp;</td>
          <td class="mdname1" valign="top" nowrap> <em>pattern</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>DatePattern</b> takes a string in the same format as expected by <a class="el" href="classlog4cxx_1_1helpers_1_1_simple_date_format.html">SimpleDateFormat</a>. 
<p>
This options determines the rollover schedule.     </td>
  </tr>
</table>
<a class="anchor" name="c1d269357907e0809687a2bec962e1c8"></a><!-- doxytag: member="log4cxx::DailyRollingFileAppender::setOption" ref="c1d269357907e0809687a2bec962e1c8" args="(const LogString &amp;option, const LogString &amp;value)" --><p>
<table class="mdTable" 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 <a class="el" href="namespacelog4cxx.html#d7ec98d27bca7666e23f27dd1fb181c8">LogString</a> &amp;&nbsp;</td>
          <td class="mdname" nowrap> <em>option</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap>const <a class="el" href="namespacelog4cxx.html#d7ec98d27bca7666e23f27dd1fb181c8">LogString</a> &amp;&nbsp;</td>
          <td class="mdname" nowrap> <em>value</em></td>
        </tr>
        <tr>
          <td class="md"></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_1_daily_rolling_file_appender.html#580abdcb8fd42d07eaf679166f77bc34">activateOptions</a> is called. 
<p>
Reimplemented from <a class="el" href="classlog4cxx_1_1_file_appender.html#c1d269357907e0809687a2bec962e1c8">FileAppender</a>.    </td>
  </tr>
</table>
<hr>The documentation for this class was generated from the following file:<ul>
<li><a class="el" href="dailyrollingfileappender_8h.html">dailyrollingfileappender.h</a></ul>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements.  See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License.  You may obtain a copy of the License at

     http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
    </BODY>
</HTML>