Imported Upstream version 1.72.0
[platform/upstream/boost.git] / libs / log / doc / html / boost / log / add_file_log.html
1 <html>
2 <head>
3 <meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
4 <title>Function template add_file_log</title>
5 <link rel="stylesheet" href="../../../../../../doc/src/boostbook.css" type="text/css">
6 <meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
7 <link rel="home" href="../../index.html" title="Chapter&#160;1.&#160;Boost.Log v2">
8 <link rel="up" href="../../utilities.html#header.boost.log.utility.setup.file_hpp" title="Header &lt;boost/log/utility/setup/file.hpp&gt;">
9 <link rel="prev" href="wadd_console_log.html" title="Function wadd_console_log">
10 <link rel="next" href="basic_filter_factory.html" title="Class template basic_filter_factory">
11 </head>
12 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
13 <table cellpadding="2" width="100%"><tr><td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../boost.png"></td></tr></table>
14 <hr>
15 <div class="spirit-nav">
16 <a accesskey="p" href="wadd_console_log.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../utilities.html#header.boost.log.utility.setup.file_hpp"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="basic_filter_factory.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
17 </div>
18 <div class="refentry">
19 <a name="boost.log.add_file_log"></a><div class="titlepage"></div>
20 <div class="refnamediv">
21 <h2><span class="refentrytitle">Function template add_file_log</span></h2>
22 <p>boost::log::add_file_log</p>
23 </div>
24 <h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
25 <div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="../../utilities.html#header.boost.log.utility.setup.file_hpp" title="Header &lt;boost/log/utility/setup/file.hpp&gt;">boost/log/utility/setup/file.hpp</a>&gt;
26
27 </span>
28 <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span><span class="special">...</span> ArgsT<span class="special">&gt;</span> 
29   <span class="identifier">shared_ptr</span><span class="special">&lt;</span> <span class="identifier">sinks</span><span class="special">::</span><span class="identifier">synchronous_sink</span><span class="special">&lt;</span> <span class="identifier">sinks</span><span class="special">::</span><span class="identifier">text_file_backend</span> <span class="special">&gt;</span> <span class="special">&gt;</span> 
30   <span class="identifier">add_file_log</span><span class="special">(</span><span class="identifier">ArgsT</span><span class="special">...</span> <span class="keyword">const</span> <span class="special">&amp;</span> args<span class="special">)</span><span class="special">;</span></pre></div>
31 <div class="refsect1">
32 <a name="idm45554722796704"></a><h2>Description</h2>
33 <p>The function initializes the logging library to write logs to a file stream.</p>
34 <p>
35
36 </p>
37 <div class="variablelist"><table border="0" class="variablelist compact">
38 <colgroup>
39 <col align="left" valign="top">
40 <col>
41 </colgroup>
42 <tbody>
43 <tr>
44 <td><p><span class="term">Parameters:</span></p></td>
45 <td><div class="variablelist"><table border="0" class="variablelist compact">
46 <colgroup>
47 <col align="left" valign="top">
48 <col>
49 </colgroup>
50 <tbody><tr>
51 <td><p><span class="term"><code class="computeroutput">args</code></span></p></td>
52 <td>
53 <p>A number of named arguments. The following parameters are supported: </p>
54 <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
55 <li class="listitem"><p><code class="computeroutput">file_name</code> The active file name or its pattern. This parameter is mandatory. </p></li>
56 <li class="listitem"><p><code class="computeroutput">target_file_name</code> - Specifies the target file name pattern to use to rename the log file on rotation, before passing it to the file collector. The pattern may contain the same placeholders as the <code class="computeroutput">file_name</code> parameter. By default, no renaming is done, i.e. the written log file keeps its name according to <code class="computeroutput">file_name</code>. </p></li>
57 <li class="listitem"><p><code class="computeroutput">open_mode</code> The mask that describes the open mode for the file. See <code class="computeroutput">std::ios_base::openmode</code>. </p></li>
58 <li class="listitem"><p><code class="computeroutput">rotation_size</code> The size of the file at which rotation should occur. See <code class="computeroutput">basic_text_file_backend</code>. </p></li>
59 <li class="listitem"><p><code class="computeroutput">time_based_rotation</code> The predicate for time-based file rotations. See <code class="computeroutput">basic_text_file_backend</code>. </p></li>
60 <li class="listitem"><p><code class="computeroutput">auto_flush</code> A boolean flag that shows whether the sink should automatically flush the file after each written record. </p></li>
61 <li class="listitem"><p><code class="computeroutput">auto_newline_mode</code> - Specifies automatic trailing newline insertion mode. Must be a value of the <code class="computeroutput">auto_newline_mode</code> enum. By default, is <code class="computeroutput">auto_newline_mode::insert_if_missing</code>. </p></li>
62 <li class="listitem"><p><code class="computeroutput">target</code> The target directory to store rotated files in. See <code class="computeroutput">sinks::file::make_collector</code>. </p></li>
63 <li class="listitem"><p><code class="computeroutput">max_size</code> The maximum total size of rotated files in the target directory. See <code class="computeroutput">sinks::file::make_collector</code>. </p></li>
64 <li class="listitem"><p><code class="computeroutput">min_free_space</code> Minimum free space in the target directory. See <code class="computeroutput">sinks::file::make_collector</code>. </p></li>
65 <li class="listitem"><p><code class="computeroutput">max_files</code> The maximum total number of rotated files in the target directory. See <code class="computeroutput">sinks::file::make_collector</code>. </p></li>
66 <li class="listitem"><p><code class="computeroutput">scan_method</code> The method of scanning the target directory for log files. See <code class="computeroutput">sinks::file::scan_method</code>. </p></li>
67 <li class="listitem"><p><code class="computeroutput">filter</code> Specifies a filter to install into the sink. May be a string that represents a filter, or a filter lambda expression. </p></li>
68 <li class="listitem"><p><code class="computeroutput">format</code> Specifies a formatter to install into the sink. May be a string that represents a formatter, or a formatter lambda expression (either streaming or Boost.Format-like notation). </p></li>
69 </ul></div>
70 <p>
71 </p>
72 </td>
73 </tr></tbody>
74 </table></div></td>
75 </tr>
76 <tr>
77 <td><p><span class="term">Returns:</span></p></td>
78 <td><p>Pointer to the constructed sink. </p></td>
79 </tr>
80 </tbody>
81 </table></div>
82 </div>
83 </div>
84 <table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
85 <td align="left"></td>
86 <td align="right"><div class="copyright-footer">Copyright &#169; 2007-2016 Andrey Semashev<p>
87         Distributed under the Boost Software License, Version 1.0. (See accompanying
88         file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>).
89       </p>
90 </div></td>
91 </tr></table>
92 <hr>
93 <div class="spirit-nav">
94 <a accesskey="p" href="wadd_console_log.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../utilities.html#header.boost.log.utility.setup.file_hpp"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="basic_filter_factory.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
95 </div>
96 </body>
97 </html>