]> granicus.if.org Git - apache/blobdiff - docs/manual/programs/rotatelogs.html.en
Update transforms
[apache] / docs / manual / programs / rotatelogs.html.en
index 3f0f1a8bf7f0353c8139c9918db05d5d69a0e582..ca046a6fc0ba507ad8c2e81a1259c02769a86a69 100644 (file)
@@ -19,7 +19,8 @@
 <a href="http://www.apache.org/">Apache</a> &gt; <a href="http://httpd.apache.org/">HTTP Server</a> &gt; <a href="http://httpd.apache.org/docs/">Documentation</a> &gt; <a href="../">Version 2.3</a> &gt; <a href="./">Programs</a></div><div id="page-content"><div id="preamble"><h1>rotatelogs - Piped logging program to rotate Apache logs</h1>
 <div class="toplang">
 <p><span>Available Languages: </span><a href="../en/programs/rotatelogs.html" title="English">&nbsp;en&nbsp;</a> |
-<a href="../ko/programs/rotatelogs.html" hreflang="ko" rel="alternate" title="Korean">&nbsp;ko&nbsp;</a></p>
+<a href="../ko/programs/rotatelogs.html" hreflang="ko" rel="alternate" title="Korean">&nbsp;ko&nbsp;</a> |
+<a href="../tr/programs/rotatelogs.html" hreflang="tr" rel="alternate" title="Türkçe">&nbsp;tr&nbsp;</a></p>
 </div>
 
      <p><code>rotatelogs</code> is a simple program for use in
@@ -37,6 +38,7 @@
 
      <p><code><strong>rotatelogs</strong>
      [ -<strong>l</strong> ]
+     [ -<strong>L</strong> <var>linkname</var> ]
      [ -<strong>f</strong> ]
      [ -<strong>v</strong> ]
      <var>logfile</var>
@@ -55,6 +57,12 @@ rotation.  Note that using <code>-l</code> in an environment which
 changes the GMT offset (such as for BST or DST) can lead to unpredictable
 results!</dd>
 
+<dt><code>-L</code> <var>linkname</var></dt>
+<dd>Causes a hard link to be made from the current logfile
+to the specified link name.  This can be used to watch
+the log continuously across rotations using a command like 
+<code>tail -F linkname</code>.</dd>
+
 <dt><code>-f</code></dt>
 <dd>Causes the logfile to be opened immediately, as soon as
 <code>rotatelogs</code> starts, instead of waiting for the
@@ -64,6 +72,14 @@ and when the first request is handled, meaning that the
 associated logfile does not "exist" until then, which
 causes problems from some automated logging tools)</dd>
 
+<dt><code>-t</code></dt>
+<dd>Causes the logfile to be truncated instead of rotated. This is
+useful when a log is processed in real time by a command like tail,
+and there is no need for archived data. No suffix will be added to
+the filename, however format strings containing '%' characters
+will be respected.
+</dd>
+
 <dt><code>-v</code></dt>
 <dd>Produce verbose output on STDERR. The output contains
 the result of the configuration parsing, and all file open and
@@ -75,11 +91,12 @@ close actions.</dd>
 includes any '%' characters, it is treated as a format string for
 <code>strftime(3)</code>.  Otherwise, the suffix
 <var>.nnnnnnnnnn</var> is automatically added and is the time in
-seconds.  Both formats compute the start time from the beginning of
-the current period.  For example, if a rotation time of 86400 is 
-specified, the hour, minute, and second fields created from the
-<code>strftime(3)</code> format will all be zero, referring to the
-beginning of the current 24-hour period (midnight).</dd>
+seconds (unless the -t option is used). Both formats compute the
+start time from the beginning of the current period.  For example,
+if a rotation time of 86400 is specified, the hour, minute, and
+second fields created from the <code>strftime(3)</code> format will
+all be zero, referring to the beginning of the current 24-hour
+period (midnight).</dd>
 
 <dt><code><var>rotationtime</var></code></dt>
 
@@ -147,6 +164,15 @@ an offset.</dd>
      will be created of the form
      <code>errorlog.YYYY-mm-dd-HH_MM_SS</code>.</p>
  
+<div class="example"><p><code>
+     CustomLog "|bin/rotatelogs -t /var/logs/logfile 86400" common
+</code></p></div>
+
+     <p>This creates the file /var/logs/logfile, truncating the file at
+     startup and then truncating the file once per day. It is expected
+     in this scenario that a separate process (such as tail) would
+     process the file in real time.</p>
+
 </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
 <div class="section">
 <h2><a name="portability" id="portability">Portability</a></h2>
@@ -186,8 +212,9 @@ extensions.</p>
 </div></div>
 <div class="bottomlang">
 <p><span>Available Languages: </span><a href="../en/programs/rotatelogs.html" title="English">&nbsp;en&nbsp;</a> |
-<a href="../ko/programs/rotatelogs.html" hreflang="ko" rel="alternate" title="Korean">&nbsp;ko&nbsp;</a></p>
+<a href="../ko/programs/rotatelogs.html" hreflang="ko" rel="alternate" title="Korean">&nbsp;ko&nbsp;</a> |
+<a href="../tr/programs/rotatelogs.html" hreflang="tr" rel="alternate" title="Türkçe">&nbsp;tr&nbsp;</a></p>
 </div><div id="footer">
-<p class="apache">Copyright 2009 The Apache Software Foundation.<br />Licensed under the <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>.</p>
+<p class="apache">Copyright 2010 The Apache Software Foundation.<br />Licensed under the <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>.</p>
 <p class="menu"><a href="../mod/">Modules</a> | <a href="../mod/directives.html">Directives</a> | <a href="../faq/">FAQ</a> | <a href="../glossary.html">Glossary</a> | <a href="../sitemap.html">Sitemap</a></p></div>
 </body></html>
\ No newline at end of file