Bug 677288 - [RFE] httpd's rotatelogs needs a way to rotate files into a custom location
[RFE] httpd's rotatelogs needs a way to rotate files into a custom location
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: httpd (Show other bugs)
All Linux
low Severity low
: rc
: ---
Assigned To: Joe Orton
BaseOS QE Security Team
: FutureFeature, Triaged
Depends On:
Blocks: 554476 726419 757735 769266
  Show dependency treegraph
Reported: 2011-02-14 04:20 EST by J.H.M. Dassen (Ray)
Modified: 2013-07-03 00:10 EDT (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of:
: 757735 (view as bug list)
Last Closed: 2012-02-21 01:33:50 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Knowledge Base (Legacy) 45307 None None None Never

  None (edit)
Description J.H.M. Dassen (Ray) 2011-02-14 04:20:34 EST
2. What is the nature and description of the request?

Customer is looking to increase their usage of httpd's rotatelogs to replace
their current custom log rotation script, but it lacks one piece of
functionality to make that possible.  They currently have a directory which
their log processing apps work out of, and to prevent any conflicts caused by
reading the currently active log file, they rotate logs into a separate
directory from where it is initially created.  So for instance, they may have
apache logging to /var/log/httpd/instance1_access.log, and once the file is
rotated out it gets moved to /data/logs/instance1_access.log and their app
picks it up.  They would like for rotatelogs to support doing something like
this.  For example, you could pass it a flag like "rotatelogs -d /data/logs/"
that would cause it to rotate logs into that custom destinatino.

3. Why does the customer need this? (List the business requirements here)

Simplified management of log files

4. How would the customer like to achieve this? (List the functional
requirements here)

A flag to rotatelogs letting you specify the destination to rotate files into

5. For each functional requirement listed in question 4, specify how Red Hat
and the customer can test to confirm the requirement is successfully

Configure rotatelogs with the flag/destination and ensure that files are moved
here after being rotated out. 

6. Is there already an existing RFE upstream or in Red Hat bugzilla?


7. How quickly does this need resolved? (desired target release)

earliest RHEL 5 minor release possible

8. Does this request meet the RHEL Inclusion criteria (please review)


9. List the affected packages

Comment 2 Joe Orton 2011-02-14 06:46:00 EST
Comment on creeping featurism in rotatelogs as per bug 677279.

Doing a rename() on the file after rotating might be feasible to add (a trivial feature, conditional on upstream acceptance), but note that this would restrict the destination location to the same partition as the source location.  Would that be acceptable to the customer?  Copying a log file across partitions would mean blocking logging (and hence request processing) for unknown length of time; not really a good idea.
Comment 5 Joe Orton 2011-06-20 06:48:13 EDT
I've committed upstream a slightly more general way to achieve this; adding a -p argument:


from the docs:

-p <program>

Causes the specified program to be executed after each rotation.
Two arguments are supplied upon execution: the newly opened file and
the previous file, respectively.  <code>rotatelogs</code> does not
wait for the specified program to terminate before continuing to
operate, and will not log any error code returned on termination.  The
spawned program uses the same stdin, stdout, and stderr as rotatelogs
itself, and also inherits the environment.

Hopefully this will be an acceptable way to provide this enhancement.
Comment 10 errata-xmlrpc 2012-02-21 01:33:50 EST
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.


Note You need to log in before you can comment on or make changes to this bug.