File: Poco.SimpleFileChannel.html

package info (click to toggle)
poco-doc 1.3.6-1
  • links: PTS
  • area: main
  • in suites: buster, jessie, jessie-kfreebsd, squeeze, stretch, wheezy
  • size: 10,076 kB
  • ctags: 9,611
  • sloc: makefile: 31
file content (153 lines) | stat: -rw-r--r-- 12,039 bytes parent folder | download | duplicates (3)
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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Class Poco::SimpleFileChannel</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
<meta name="author" content="Applied Informatics Software Engineering GmbH and Contributors"/>
<meta name="publisher" content="Applied Informatics Software Engineering GmbH and Contributors"/>
<meta name="copyright" content="Copyright (c) 2009, Applied Informatics Software Engineering GmbH and Contributors"/>
<meta name="language" content="en"/>
<meta name="date" content="2009-11-24"/>
<meta name="generator" content="PocoDoc"/>
<link rel="stylesheet" href="css/styles.css" type="text/css"/>
</head>
<body bgcolor="#ffffff" leftmargin="0" topmargin="0">
<div class="header">
<h1 class="namespace"><a href="Poco.html" class="namespace">Poco</a></h1>
<h1 class="symbol">class SimpleFileChannel</h1>
</div>
<div class="body">
<p>
<b>Library:</b> Foundation<br />
<b>Package:</b> Logging<br />
<b>Header:</b> Poco/SimpleFileChannel.h</p>
<h2>Description</h2>
<div class="description">
<p>A <a href="Poco.Channel.html" title="class Poco::Channel">Channel</a> that writes to a file. This class only supports simple log file rotation. </p>
<p>For more features, see the <a href="Poco.FileChannel.html" title="class Poco::FileChannel">FileChannel</a> class. </p>
<p>Only the message's text is written, followed by a newline. </p>
<p>Chain this channel to a <a href="Poco.FormattingChannel.html" title="class Poco::FormattingChannel">FormattingChannel</a> with an appropriate <a href="Poco.Formatter.html" title="class Poco::Formatter">Formatter</a> to control what is in the text.  </p>
<p>Log file rotation based on log file size is supported. </p>
<p>If rotation is enabled, the <a href="Poco.SimpleFileChannel.html" title="class Poco::SimpleFileChannel">SimpleFileChannel</a> will  alternate between two log files. If the size of the primary log file exceeds a specified limit, the secondary log file will be used, and vice versa.  </p>
<p>Log rotation is configured with the &quot;rotation&quot; property, which supports the following values: </p>
<ul>
<li>never:         no log rotation </li>
<li>&lt;n&gt;:           the file is rotated when its size exceeds &lt;n&gt; bytes. </li>
<li>&lt;n&gt; K:         the file is rotated when its size exceeds &lt;n&gt; Kilobytes. </li>
<li>&lt;n&gt; M:         the file is rotated when its size exceeds &lt;n&gt; Megabytes. </li>
</ul>
<p>The path of the (primary) log file can be specified with the &quot;path&quot; property. Optionally, the path of the secondary log file can be specified with the &quot;secondaryPath&quot; property. </p>
<p>If no secondary path is specified, the secondary path will default to &lt;primaryPath&gt;.1. </p>
</div>
<h2>Inheritance</h2>
<p><b>Direct Base Classes: </b><a href="Poco.Channel.html" title="class Poco::Channel">Channel</a></p>
<p><b>All Base Classes: </b><a href="Poco.Channel.html" title="class Poco::Channel">Channel</a>, <a href="Poco.Configurable.html" title="class Poco::Configurable">Configurable</a>, <a href="Poco.RefCountedObject.html" title="class Poco::RefCountedObject">RefCountedObject</a></p>
<h2>Member Summary</h2>
<p><b>Member Functions: </b><a href="Poco.SimpleFileChannel.html#10070" title="Poco::SimpleFileChannel::close()">close</a>, <a href="Poco.SimpleFileChannel.html#10078" title="Poco::SimpleFileChannel::creationDate()">creationDate</a>, <a href="Poco.SimpleFileChannel.html#10076" title="Poco::SimpleFileChannel::getProperty()">getProperty</a>, <a href="Poco.SimpleFileChannel.html#10071" title="Poco::SimpleFileChannel::log()">log</a>, <a href="Poco.SimpleFileChannel.html#10069" title="Poco::SimpleFileChannel::open()">open</a>, <a href="Poco.SimpleFileChannel.html#10080" title="Poco::SimpleFileChannel::path()">path</a>, <a href="Poco.SimpleFileChannel.html#10088" title="Poco::SimpleFileChannel::rotate()">rotate</a>, <a href="Poco.SimpleFileChannel.html#10081" title="Poco::SimpleFileChannel::secondaryPath()">secondaryPath</a>, <a href="Poco.SimpleFileChannel.html#10073" title="Poco::SimpleFileChannel::setProperty()">setProperty</a>, <a href="Poco.SimpleFileChannel.html#10086" title="Poco::SimpleFileChannel::setRotation()">setRotation</a>, <a href="Poco.SimpleFileChannel.html#10079" title="Poco::SimpleFileChannel::size()">size</a></p>
<p><b>Inherited Functions: </b><a href="Poco.Channel.html#4145" title="Poco::Channel::close()">close</a>, <a href="Poco.RefCountedObject.html#9659" title="Poco::RefCountedObject::duplicate()">duplicate</a>, <a href="Poco.Channel.html#4151" title="Poco::Channel::getProperty()">getProperty</a>, <a href="Poco.Channel.html#4146" title="Poco::Channel::log()">log</a>, <a href="Poco.Channel.html#4144" title="Poco::Channel::open()">open</a>, <a href="Poco.RefCountedObject.html#9661" title="Poco::RefCountedObject::referenceCount()">referenceCount</a>, <a href="Poco.RefCountedObject.html#9660" title="Poco::RefCountedObject::release()">release</a>, <a href="Poco.Channel.html#4148" title="Poco::Channel::setProperty()">setProperty</a></p>
<h2>Constructors</h2>
<h3><a name="10066">SimpleFileChannel</a></h3>
<p class="decl"><a href="Poco.SimpleFileChannel.html" title="class Poco::SimpleFileChannel">SimpleFileChannel</a>();</p>
<div class="description">
<p>Creates the <a href="Poco.FileChannel.html" title="class Poco::FileChannel">FileChannel</a>. </p>
</div>
<h3><a name="10067">SimpleFileChannel</a></h3>
<p class="decl"><a href="Poco.SimpleFileChannel.html" title="class Poco::SimpleFileChannel">SimpleFileChannel</a>(<br />&nbsp;&nbsp;&nbsp;&nbsp;const std::string &amp; path<br />);</p>
<div class="description">
<p>Creates the <a href="Poco.FileChannel.html" title="class Poco::FileChannel">FileChannel</a> for a file with the given path. </p>
</div>
<h2>Destructor</h2>
<h3><a name="10085">~SimpleFileChannel</a> <img src="images/protected.gif" alt="protected" title="protected" style="vertical-align:baseline;" border="0" />  <img src="images/virtual.gif" alt="virtual" title="virtual" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">~<a href="Poco.SimpleFileChannel.html" title="class Poco::SimpleFileChannel">SimpleFileChannel</a>();</p>
<div class="description">
<p></p>
</div>
<h2>Member Functions</h2>
<h3><a name="10070">close</a> <img src="images/virtual.gif" alt="virtual" title="virtual" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">void close();</p>
<div class="description">
<p>Closes the <a href="Poco.FileChannel.html" title="class Poco::FileChannel">FileChannel</a>. </p>
</div>
<div class="description"><p><b>See also:</b> <a href="Poco.Channel.html#4145" title="Poco::Channel::close()">Poco::Channel::close()</a></p></div>
<h3><a name="10078">creationDate</a></h3>
<p class="decl"><a href="Poco.Timestamp.html" title="class Poco::Timestamp">Timestamp</a> creationDate() const;</p>
<div class="description">
<p>Returns the log file's creation date. </p>
</div>
<h3><a name="10076">getProperty</a> <img src="images/virtual.gif" alt="virtual" title="virtual" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">std::string getProperty(<br />&nbsp;&nbsp;&nbsp;&nbsp;const std::string &amp; name<br />) const;</p>
<div class="description">
<p>Returns the value of the property with the given name. See <a href="Poco.SimpleFileChannel.html#10073" title="Poco::SimpleFileChannel::setProperty()">setProperty</a>() for a description of the supported properties. </p>
</div>
<div class="description"><p><b>See also:</b> <a href="Poco.Channel.html#4151" title="Poco::Channel::getProperty()">Poco::Channel::getProperty()</a></p></div>
<h3><a name="10071">log</a> <img src="images/virtual.gif" alt="virtual" title="virtual" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">void log(<br />&nbsp;&nbsp;&nbsp;&nbsp;const <a href="Poco.Message.html" title="class Poco::Message">Message</a> &amp; msg<br />);</p>
<div class="description">
<p>Logs the given message to the file. </p>
</div>
<div class="description"><p><b>See also:</b> <a href="Poco.Channel.html#4146" title="Poco::Channel::log()">Poco::Channel::log()</a></p></div>
<h3><a name="10069">open</a> <img src="images/virtual.gif" alt="virtual" title="virtual" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">void open();</p>
<div class="description">
<p>Opens the <a href="Poco.FileChannel.html" title="class Poco::FileChannel">FileChannel</a> and creates the log file if necessary. </p>
</div>
<div class="description"><p><b>See also:</b> <a href="Poco.Channel.html#4144" title="Poco::Channel::open()">Poco::Channel::open()</a></p></div>
<h3><a name="10080">path</a></h3>
<p class="decl">const std::string &amp; path() const;</p>
<div class="description">
<p>Returns the log file's primary path. </p>
</div>
<h3><a name="10081">secondaryPath</a></h3>
<p class="decl">const std::string &amp; secondaryPath() const;</p>
<div class="description">
<p>Returns the log file's secondary path. </p>
</div>
<h3><a name="10073">setProperty</a> <img src="images/virtual.gif" alt="virtual" title="virtual" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">void setProperty(<br />&nbsp;&nbsp;&nbsp;&nbsp;const std::string &amp; name,<br />&nbsp;&nbsp;&nbsp;&nbsp;const std::string &amp; value<br />);</p>
<div class="description">
<p>Sets the property with the given name.  </p>
<p>The following properties are supported: </p>
<ul>
<li>path:          The primary log file's path. </li>
<li>secondaryPath: The secondary log file's path. </li>
<li>rotation:      The log file's rotation mode. See the  <a href="Poco.SimpleFileChannel.html" title="class Poco::SimpleFileChannel">SimpleFileChannel</a> class for details. </li>
</ul>
</div>
<div class="description"><p><b>See also:</b> <a href="Poco.Channel.html#4148" title="Poco::Channel::setProperty()">Poco::Channel::setProperty()</a></p></div>
<h3><a name="10079">size</a></h3>
<p class="decl"><a href="Poco.html#11358" title="Poco::UInt64">UInt64</a> size() const;</p>
<div class="description">
<p>Returns the log file's current size in bytes. </p>
</div>
<h3><a name="10088">rotate</a> <img src="images/protected.gif" alt="protected" title="protected" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">void rotate();</p>
<div class="description">
<p></p>
</div>
<h3><a name="10086">setRotation</a> <img src="images/protected.gif" alt="protected" title="protected" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">void setRotation(<br />&nbsp;&nbsp;&nbsp;&nbsp;const std::string &amp; rotation<br />);</p>
<div class="description">
<p></p>
</div>
<h2>Variables</h2>
<h3><a name="10082">PROP_PATH</a> <img src="images/static.gif" alt="static" title="static" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">static const std::string <a href="Poco.SimpleFileChannel.html#10082" title="Poco::SimpleFileChannel::PROP_PATH">PROP_PATH</a>;</p>
<div class="description">
<p></p>
</div>
<h3><a name="10084">PROP_ROTATION</a> <img src="images/static.gif" alt="static" title="static" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">static const std::string <a href="Poco.SimpleFileChannel.html#10084" title="Poco::SimpleFileChannel::PROP_ROTATION">PROP_ROTATION</a>;</p>
<div class="description">
<p></p>
</div>
<h3><a name="10083">PROP_SECONDARYPATH</a> <img src="images/static.gif" alt="static" title="static" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">static const std::string <a href="Poco.SimpleFileChannel.html#10083" title="Poco::SimpleFileChannel::PROP_SECONDARYPATH">PROP_SECONDARYPATH</a>;</p>
<div class="description">
<p></p>
</div>
<p class="footer">POCO C++ Libraries 1.3.6-all<br />
Copyright &copy; 2009, <a href="http://pocoproject.org/" target="_blank">Applied Informatics Software Engineering GmbH and Contributors</a></p>

</div>
</body>
</html>