|
48 | 48 | </itemizedlist>
|
49 | 49 | </para>
|
50 | 50 | </section>
|
51 |
| - </section> |
| 51 | + </section> |
52 | 52 | <section>
|
53 | 53 | <title>External Libraries or Applications</title>
|
54 | 54 | <para>
|
@@ -166,6 +166,42 @@ modparam("event_flatstore", "rotate_period", 3660) # rotate every hour
|
166 | 166 | ...
|
167 | 167 | </programlisting>
|
168 | 168 | </example>
|
| 169 | +` </section> |
| 170 | + <section id="param_rotate_count" xreflabel="rotate_count"> |
| 171 | + <title><varname>rotate_count</varname> (int|string)</title> |
| 172 | + <para> |
| 173 | + Defines after how many written lines the log file is rotated. |
| 174 | + The value may exceed the 32-bit integer limit; in that case pass |
| 175 | + it <emphasis>as a string</emphasis>, e.g. "5000000000". |
| 176 | + </para> |
| 177 | + <para><emphasis>Default value is <quote>0/OFF</quote>.</emphasis></para> |
| 178 | + <example> |
| 179 | + <title>Rotate after five billion lines</title> |
| 180 | + <programlisting format="linespecific"> |
| 181 | +... |
| 182 | +modparam("event_flatstore", "rotate_count", "5000000000") |
| 183 | +... |
| 184 | + </programlisting> |
| 185 | + </example> |
| 186 | + </section> |
| 187 | + <section id="param_rotate_size" xreflabel="rotate_size"> |
| 188 | + <title><varname>rotate_size</varname> (int|string)</title> |
| 189 | + <para> |
| 190 | + Sets the maximum size of a file before it is rotated. A size |
| 191 | + suffix of <quote>k</quote>, <quote>m</quote> or <quote>g</quote> |
| 192 | + (multiples of 1024) may be provided. |
| 193 | + Very large values can be supplied as strings, e.g. |
| 194 | + "8589934592" for 8 GiB. |
| 195 | + </para> |
| 196 | + <para><emphasis>Default value is <quote>0/OFF</quote>.</emphasis></para> |
| 197 | + <example> |
| 198 | + <title>Rotate at 2 GiB</title> |
| 199 | +<programlisting format="linespecific"> |
| 200 | +... |
| 201 | +modparam("event_flatstore", "rotate_size", "2g") |
| 202 | +... |
| 203 | +</programlisting> |
| 204 | + </example> |
169 | 205 | </section>
|
170 | 206 | <section id="param_suffix" xreflabel="suffix">
|
171 | 207 | <title><varname>suffix</varname> (string)</title>
|
@@ -223,11 +259,48 @@ modparam("event_flatstore", "suffix", "$time(%Y)")
|
223 | 259 | <para>
|
224 | 260 | MI FIFO Command Format:
|
225 | 261 | </para>
|
226 |
| - <programlisting format="linespecific"> |
227 |
| - opensips-cli -x mi evi_flat_rotate _path_to_log_file_ |
| 262 | + <programlisting format="linespecific"> |
| 263 | +... |
| 264 | +opensips-cli -x mi evi_flat_rotate _path_to_log_file_ |
| 265 | +... |
228 | 266 | </programlisting>
|
229 | 267 | </section>
|
230 |
| - </section> |
231 |
| -</chapter> |
| 268 | + </section> |
| 269 | + |
| 270 | + <section id="exported_events" xreflabel="Exported Events"> |
| 271 | + <title>Exported Events</title> |
232 | 272 |
|
| 273 | + <section id="event_E_FLATSTORE_ROTATION" xreflabel="E_FLATSTORE_ROTATION"> |
| 274 | + <title> |
| 275 | + <function moreinfo="none">E_FLATSTORE_ROTATION</function> |
| 276 | + </title> |
233 | 277 |
|
| 278 | + <para> |
| 279 | + The event is raised every time <emphasis>event_flatstore</emphasis> |
| 280 | + opens a new log file (manual <command>evi_flat_rotate</command>, |
| 281 | + auto-rotate by <varname>rotate_period</varname>, or |
| 282 | + thresholds <varname>rotate_count</varname>/<varname>rotate_size</varname>). |
| 283 | + External apps can subscribe to monitor log-rotation activity. |
| 284 | + </para> |
| 285 | + |
| 286 | + <para>Parameters:</para> |
| 287 | + <itemizedlist> |
| 288 | + <listitem><para> |
| 289 | + <emphasis>timestamp</emphasis> – Unix epoch (seconds) when the |
| 290 | + rotation was performed. |
| 291 | + </para></listitem> |
| 292 | + <listitem><para> |
| 293 | + <emphasis>reason</emphasis> – one of the strings |
| 294 | + <emphasis>count</emphasis>, <emphasis>size</emphasis>, |
| 295 | + <emphasis>period</emphasis> or <emphasis>mi</emphasis>. |
| 296 | + </para></listitem> |
| 297 | + <listitem><para> |
| 298 | + <emphasis>filename</emphasis> – full path of the new log file. |
| 299 | + </para></listitem> |
| 300 | + <listitem><para> |
| 301 | + <emphasis>old_filename</emphasis> – full path of the previous log file. |
| 302 | + </para></listitem> |
| 303 | + </itemizedlist> |
| 304 | + </section> |
| 305 | + </section> |
| 306 | +</chapter> |
0 commit comments