From 1abc28d88cc7b2f23a9b3685ece0f60de7db9c1b Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Tue, 20 Nov 2007 21:36:12 +0000 Subject: [PATCH] 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 git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@596830 13f79535-47bb-0310-9956-ffa450edef68 --- docs/manual/programs/rotatelogs.xml | 81 +++++++++++++++++------------ 1 file changed, 48 insertions(+), 33 deletions(-) diff --git a/docs/manual/programs/rotatelogs.xml b/docs/manual/programs/rotatelogs.xml index 86ebb94476..5e8c65d3fc 100644 --- a/docs/manual/programs/rotatelogs.xml +++ b/docs/manual/programs/rotatelogs.xml @@ -27,33 +27,7 @@

rotatelogs is a simple program for use in - conjunction with Apache's piped logfile feature. For example:

- - - CustomLog "|bin/rotatelogs /var/logs/logfile 86400" common - - -

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.

- - - CustomLog "|bin/rotatelogs /var/logs/logfile 5M" common - - -

This configuration will rotate the logfile whenever it reaches - a size of 5 megabytes.

- - - ErrorLog "|bin/rotatelogs /var/logs/errorlog.%Y-%m-%d-%H_%M_%S 5M" - -

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 - errorlog.YYYY-mm-dd-HH_MM_SS.

- + conjunction with Apache's piped logfile feature.

Synopsis @@ -61,8 +35,8 @@

rotatelogs [ -l ] logfile - [ rotationtime [ offset ]] | - [ filesizeM ]

+ rotationtime|filesizeM + [ offset ]

Options @@ -71,8 +45,10 @@
-l
Causes the use of local time rather than GMT as the base for the -interval. Note that using -l in an environment which changes the -GMT offset (such as for BST or DST) can lead to unpredictable results!
+interval or for strftime(3) formatting with size-based +rotation. Note that using -l in an environment which +changes the GMT offset (such as for BST or DST) can lead to unpredictable +results!
logfile
@@ -91,16 +67,55 @@ the current period.
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 -300 for this argument.
+UTC -5 hours, specify a value of -300 for this argument. +In most cases, -l should be used instead of specifying +an offset.
filesizeM
The maximum file size in megabytes followed by the letter M to specify size rather than time. Use this parameter -in place of both rotationtime and offset.
+in place of rotationtime.
+
Examples + + + CustomLog "|bin/rotatelogs /var/logs/logfile 86400" common + + +

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.

+ + + CustomLog "|bin/rotatelogs -l /var/logs/logfile.%Y.%m.%d 86400" common + + +

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.

+ + + CustomLog "|bin/rotatelogs /var/logs/logfile 5M" common + + +

This configuration will rotate the logfile whenever it reaches + a size of 5 megabytes.

+ + + ErrorLog "|bin/rotatelogs /var/logs/errorlog.%Y-%m-%d-%H_%M_%S 5M" + +

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 + errorlog.YYYY-mm-dd-HH_MM_SS.

+ +
+
Portability

The following logfile format string substitutions should be -- 2.40.0