summaryrefslogtreecommitdiffstats
path: root/docs/manual/programs/rotatelogs.html.en
diff options
context:
space:
mode:
Diffstat (limited to 'docs/manual/programs/rotatelogs.html.en')
-rw-r--r--docs/manual/programs/rotatelogs.html.en87
1 files changed, 58 insertions, 29 deletions
diff --git a/docs/manual/programs/rotatelogs.html.en b/docs/manual/programs/rotatelogs.html.en
index 1c6576e..4635fe5 100644
--- a/docs/manual/programs/rotatelogs.html.en
+++ b/docs/manual/programs/rotatelogs.html.en
@@ -1,7 +1,7 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
+<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"><head>
-<meta content="text/html; charset=ISO-8859-1" http-equiv="Content-Type" />
+<meta content="text/html; charset=UTF-8" http-equiv="Content-Type" />
<!--
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
This file is generated from xml source: DO NOT EDIT
@@ -24,9 +24,9 @@
<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.4</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="../fr/programs/rotatelogs.html" hreflang="fr" rel="alternate" title="Français">&nbsp;fr&nbsp;</a> |
+<a href="../fr/programs/rotatelogs.html" hreflang="fr" rel="alternate" title="Français">&nbsp;fr&nbsp;</a> |
<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>
+<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
@@ -68,10 +68,16 @@ interval or for <code>strftime(3)</code> formatting with size-based
rotation.</dd>
<dt><code>-L</code> <var>linkname</var></dt>
-<dd>Causes a hard link to be made from the current logfile
+<dd><p>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>
+<code>tail -F linkname</code>.</p>
+<p>If the linkname is not an absolute
+path, it is relative to <code>rotatelogs</code>' working directory,
+which is the <code class="directive"><a href="../mod/core.html#serverroot">ServerRoot</a></code> when
+<code>rotatelogs</code> is run by the server.
+</p>
+</dd>
<dt><code>-p</code> <var>program</var></dt>
@@ -107,6 +113,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
@@ -120,9 +133,16 @@ processed in real time by a further tool in the chain.</dd>
<dd>Create log file for each interval, even if empty.</dd>
<dt><code>-n <var>number-of-files</var></code></dt>
-<dd>Use a circular list of filenames without timestamps.
-With -n 3, the series of log files opened would be
-"logfile", "logfile.1", "logfile.2", then overwriting "logfile".
+<dd>Use a circular list of filenames without timestamps. This option overwrites
+log files at startup and during rotation. With -n 3, the series of log
+files opened would be "logfile", "logfile.1", "logfile.2", then overwriting
+"logfile".
+<br />
+When this program first opens "logfile", the file will only be truncated if <code>-t</code> is also provided. Every subsequent rotation will
+always begin with truncation of the target file. For size based rotation without <code>-t</code> and existing log files in place,
+this option may result in unintuitive behavior such as initial log entries being sent to "logfile.1", and entries in "logfile.1" not being preserved
+even if later "logfile.n" have not yet been used.
+<br />
Available in 2.4.5 and later.</dd>
<dt><code><var>logfile</var></code></dt>
@@ -146,6 +166,11 @@ one. For example, if <var>logfile</var> was
megabytes, but 5 megabytes was reached twice in the same day, the
same log file name would be produced and log rotation would keep
writing to the same file.</p>
+<p>If the logfile is not an absolute
+path, it is relative to <code>rotatelogs</code>' working directory,
+which is the <code class="directive"><a href="../mod/core.html#serverroot">ServerRoot</a></code> when
+<code>rotatelogs</code> is run by the server.
+</p>
</dd>
<dt><code><var>rotationtime</var></code></dt>
@@ -181,9 +206,8 @@ an offset.</dd>
<div class="section">
<h2><a name="examples" id="examples">Examples</a></h2>
-<div class="example"><p><code>
- CustomLog "|bin/rotatelogs /var/log/logfile 86400" common
-</code></p></div>
+<div class="example"><pre class="prettyprint lang-config">CustomLog "|bin/rotatelogs /var/log/logfile 86400" common</pre>
+</div>
<p>This creates the files /var/log/logfile.nnnn where nnnn is
the system time at which the log nominally starts (this time
@@ -191,38 +215,43 @@ an offset.</dd>
synchronize cron scripts with it). At the end of each rotation
time (here after 24 hours) a new log is started.</p>
-<div class="example"><p><code>
- CustomLog "|bin/rotatelogs -l /var/log/logfile.%Y.%m.%d 86400" common
-</code></p></div>
+<div class="example"><pre class="prettyprint lang-config">CustomLog "|bin/rotatelogs -l /var/log/logfile.%Y.%m.%d 86400" common</pre>
+</div>
<p>This creates the files /var/log/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>
-<div class="example"><p><code>
- CustomLog "|bin/rotatelogs /var/log/logfile 5M" common
-</code></p></div>
+<div class="example"><pre class="prettyprint lang-config">CustomLog "|bin/rotatelogs /var/log/logfile 5M" common</pre>
+</div>
<p>This configuration will rotate the logfile whenever it reaches
a size of 5 megabytes.</p>
-<div class="example"><p><code>
- ErrorLog "|bin/rotatelogs /var/log/errorlog.%Y-%m-%d-%H_%M_%S 5M"
-</code></p></div>
+<div class="example"><pre class="prettyprint lang-config">ErrorLog "|bin/rotatelogs /var/log/errorlog.%Y-%m-%d-%H_%M_%S 5M"</pre>
+</div>
<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>
-<div class="example"><p><code>
- CustomLog "|bin/rotatelogs -t /var/log/logfile 86400" common
-</code></p></div>
+<div class="example"><pre class="prettyprint lang-config">CustomLog "|bin/rotatelogs -t /var/log/logfile 86400" common</pre>
+</div>
- <p>This creates the file /var/log/logfile, truncating the file at
+ <p>This creates the file <code>/var/log/logfile</code>, 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 class="example"><pre class="prettyprint lang-config">CustomLog "|bin/rotatelogs -T /var/log/logfile.%d 86400" common</pre>
+</div>
+
+<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>
+
</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>
@@ -262,10 +291,10 @@ 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="../fr/programs/rotatelogs.html" hreflang="fr" rel="alternate" title="Français">&nbsp;fr&nbsp;</a> |
+<a href="../fr/programs/rotatelogs.html" hreflang="fr" rel="alternate" title="Français">&nbsp;fr&nbsp;</a> |
<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 class="top"><a href="#page-header"><img src="../images/up.gif" alt="top" /></a></div><div class="section"><h2><a id="comments_section" name="comments_section">Comments</a></h2><div class="warning"><strong>Notice:</strong><br />This is not a Q&amp;A section. Comments placed here should be pointed towards suggestions on improving the documentation or server, and may be removed again by our moderators if they are either implemented or considered invalid/off-topic. Questions on how to manage the Apache HTTP Server should be directed at either our IRC channel, #httpd, on Freenode, or sent to our <a href="http://httpd.apache.org/lists.html">mailing lists</a>.</div>
+<a href="../tr/programs/rotatelogs.html" hreflang="tr" rel="alternate" title="Türkçe">&nbsp;tr&nbsp;</a></p>
+</div><div class="top"><a href="#page-header"><img src="../images/up.gif" alt="top" /></a></div><div class="section"><h2><a id="comments_section" name="comments_section">Comments</a></h2><div class="warning"><strong>Notice:</strong><br />This is not a Q&amp;A section. Comments placed here should be pointed towards suggestions on improving the documentation or server, and may be removed by our moderators if they are either implemented or considered invalid/off-topic. Questions on how to manage the Apache HTTP Server should be directed at either our IRC channel, #httpd, on Libera.chat, or sent to our <a href="https://httpd.apache.org/lists.html">mailing lists</a>.</div>
<script type="text/javascript"><!--//--><![CDATA[//><!--
var comments_shortname = 'httpd';
var comments_identifier = 'http://httpd.apache.org/docs/2.4/programs/rotatelogs.html';
@@ -283,7 +312,7 @@ var comments_identifier = 'http://httpd.apache.org/docs/2.4/programs/rotatelogs.
}
})(window, document);
//--><!]]></script></div><div id="footer">
-<p class="apache">Copyright 2019 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 2024 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="http://wiki.apache.org/httpd/FAQ">FAQ</a> | <a href="../glossary.html">Glossary</a> | <a href="../sitemap.html">Sitemap</a></p></div><script type="text/javascript"><!--//--><![CDATA[//><!--
if (typeof(prettyPrint) !== 'undefined') {
prettyPrint();