summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorEric Covener <covener@apache.org>2023-03-03 14:20:27 +0000
committerEric Covener <covener@apache.org>2023-03-03 14:20:27 +0000
commitcb6ad2f13850c3c68f78b233fcfadeac45125201 (patch)
treefee49f5ad4c7e36cba1a033da0ce371f529bc184 /docs
parent706538cafe99fac1d07e96d37660c0f655061aaa (diff)
downloadhttpd-cb6ad2f13850c3c68f78b233fcfadeac45125201.tar.gz
backport 1906428,1906433,1907993 from trunk
add rotatelogs -T to truncate all but the first-opened file. + docs tweak for compat git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1908025 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'docs')
-rw-r--r--docs/manual/programs/rotatelogs.xml19
1 files changed, 19 insertions, 0 deletions
diff --git a/docs/manual/programs/rotatelogs.xml b/docs/manual/programs/rotatelogs.xml
index f152721af6..5b31a8af0e 100644
--- a/docs/manual/programs/rotatelogs.xml
+++ b/docs/manual/programs/rotatelogs.xml
@@ -104,6 +104,13 @@ the filename, however format strings containing '%' characters
will be respected.
</dd>
+<dt><code>-T</code></dt>
+<dd>Causes all but the initial logfile to be truncated when opened.
+This is useful when the format string contains something that will
+loop around, such as the day of the month. Available in 2.4.56 and later.
+</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
@@ -242,6 +249,18 @@ an offset.</dd>
in this scenario that a separate process (such as tail) would
process the file in real time.</p>
+<example>
+<highlight language="config">
+ CustomLog "|bin/rotatelogs -T /var/log/logfile.%d 86400" common
+</highlight>
+</example>
+
+<p>If the server is started (or restarted) on the first of the month, this
+appends to <code>/var/log/logfile.01</code>. When a log entry is written on the
+second of the month, <code>/var/log/logfile.02</code> is truncated and new entries
+will be added to the top. This example keeps approximately 1 months worth of
+logs without external maintenance.</p>
+
</section>
<section id="portability"><title>Portability</title>