ONLamp.com
oreilly.comSafari Books Online.Conferences.
BooksAll ArticlesSafari BookshelfO'Reilly GearFree Newsletters

FAQS
 FAQs
Apache FAQ
Linux FAQ
XML FAQ

Log in to particpate





TECH JOBS


   Apache FAQ > I. Features
Question:  How can I rotate my log files?
Answer:

The simple answer: by piping the transfer log into an appropriate log file rotation utility.

The longer answer: In the src/support/ directory, you will find a utility called rotatelogs which can be used like this:

   TransferLog "|/path/to/rotatelogs /path/to/logs/access_log 86400"

to enable daily rotation of the log files.
A more sophisticated solution of a logfile rotation utility is available under the name cronolog from Andrew Ford's site at http://www.ford-mason.co.uk/resources/cronolog/. It can automatically create logfile subdirectories based on time and date, and can have a constant symlink point to the rotating logfiles. (As of version 1.6.1, cronolog is available under the Apache License). Use it like this:

   CustomLog "|/path/to/cronolog --symlink=/usr/local/apache/logs/access_log /usr/local/apache/logs/%Y/%m/access_log" combined

This FAQ is from Apache Server Frequently Asked Questions

Sponsored by:

Contact UsMedia KitPrivacy PolicyPress NewsJobs @ O'Reilly
Copyright © 2000-2006 O’Reilly Media, Inc. All Rights Reserved.
All trademarks and registered trademarks appearing on the O'Reilly Network are the property of their respective owners.
For problems or assistance with this site, email