You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by tr...@apache.org on 2007/11/20 22:36:13 UTC

svn commit: r596830 - /httpd/httpd/trunk/docs/manual/programs/rotatelogs.xml

Author: trawick
Date: Tue Nov 20 13:36:12 2007
New Revision: 596830

URL: http://svn.apache.org/viewvc?rev=596830&view=rev
Log:
update rotatelogs docs to reflect the support for -l/UTC-offset
with size-based rotation

move examples to a formal section in the customary order

add an example of logging at midnight with the date in the
filename

Modified:
    httpd/httpd/trunk/docs/manual/programs/rotatelogs.xml

Modified: httpd/httpd/trunk/docs/manual/programs/rotatelogs.xml
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/docs/manual/programs/rotatelogs.xml?rev=596830&r1=596829&r2=596830&view=diff
==============================================================================
--- httpd/httpd/trunk/docs/manual/programs/rotatelogs.xml (original)
+++ httpd/httpd/trunk/docs/manual/programs/rotatelogs.xml Tue Nov 20 13:36:12 2007
@@ -27,33 +27,7 @@
 
 <summary>
      <p><code>rotatelogs</code> is a simple program for use in
-     conjunction with Apache's piped logfile feature.  For example:</p>
-
-<example>
-     CustomLog "|bin/rotatelogs /var/logs/logfile 86400" common
-</example>
-	 
-     <p>This creates the files /var/logs/logfile.nnnn where nnnn  is
-     the system time at which the log nominally starts (this time
-     will always be a multiple of the rotation time, so  you  can
-     synchronize cron scripts with it).  At the end of each rotation
-     time (here after 24 hours) a new log is started.</p>
-
-<example>
-     CustomLog "|bin/rotatelogs /var/logs/logfile 5M" common
-</example>
-
-     <p>This configuration will rotate the logfile whenever it reaches
-     a size of 5 megabytes.</p>
-
-<example>
-     ErrorLog "|bin/rotatelogs /var/logs/errorlog.%Y-%m-%d-%H_%M_%S 5M"
-</example>
-     <p>This configuration will rotate the error logfile whenever it
-     reaches a size of 5 megabytes, and the suffix to the logfile name
-     will be created of the form
-     <code>errorlog.YYYY-mm-dd-HH_MM_SS</code>.</p>
- 
+     conjunction with Apache's piped logfile feature.</p>
 </summary>
 
 <section id="synopsis"><title>Synopsis</title>
@@ -61,8 +35,8 @@
      <p><code><strong>rotatelogs</strong>
      [ -<strong>l</strong> ]
      <var>logfile</var>
-     [ <var>rotationtime</var> [ <var>offset</var> ]] |
-     [ <var>filesize</var>M ]</code></p>
+     <var>rotationtime</var>|<var>filesize</var>M 
+     [ <var>offset</var> ]</code></p>
 </section>
 
 <section id="options"><title>Options</title>
@@ -71,8 +45,10 @@
 
 <dt><code>-l</code></dt>
 <dd>Causes the use of local time rather than GMT as the base for the
-interval. 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>
+interval or for <code>strftime(3)</code> formatting with size-based 
+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><var>logfile</var></code></dt>
 
@@ -91,14 +67,53 @@
 
 <dd>The number of minutes offset from UTC.  If omitted, zero is
 assumed and UTC is used.  For example, to use local time in the zone
-UTC -5 hours, specify a value of <code>-300</code> for this argument.</dd>
+UTC -5 hours, specify a value of <code>-300</code> for this argument.
+In most cases, <code>-l</code> should be used instead of specifying
+an offset.</dd>
 
 <dt><code><var>filesize</var>M</code></dt>
 
 <dd>The maximum file size in megabytes followed by the letter
 <code>M</code> to specify size rather than time.  Use this parameter
-in place of both rotationtime and offset.</dd>
+in place of rotationtime.</dd>
 </dl>
+</section>
+
+<section id="examples"><title>Examples</title>
+
+<example>
+     CustomLog "|bin/rotatelogs /var/logs/logfile 86400" common
+</example>
+	 
+     <p>This creates the files /var/logs/logfile.nnnn where nnnn  is
+     the system time at which the log nominally starts (this time
+     will always be a multiple of the rotation time, so  you  can
+     synchronize cron scripts with it).  At the end of each rotation
+     time (here after 24 hours) a new log is started.</p>
+
+<example>
+     CustomLog "|bin/rotatelogs -l /var/logs/logfile.%Y.%m.%d 86400" common
+</example>
+	 
+     <p>This creates the files /var/logs/logfile.yyyy.mm.dd where
+     yyyy is the year, mm is the month, and dd is the day of the month.
+     Logging will switch to a new file every day at midnight, local time.</p>
+
+<example>
+     CustomLog "|bin/rotatelogs /var/logs/logfile 5M" common
+</example>
+
+     <p>This configuration will rotate the logfile whenever it reaches
+     a size of 5 megabytes.</p>
+
+<example>
+     ErrorLog "|bin/rotatelogs /var/logs/errorlog.%Y-%m-%d-%H_%M_%S 5M"
+</example>
+     <p>This configuration will rotate the error logfile whenever it
+     reaches a size of 5 megabytes, and the suffix to the logfile name
+     will be created of the form
+     <code>errorlog.YYYY-mm-dd-HH_MM_SS</code>.</p>
+ 
 </section>
 
 <section id="portability"><title>Portability</title>