Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 11 Mar 2002 18:51:12 +0000
From:      Jamie Jones <jamie@catflap.bishopston.net>
To:        "alexus" <ml@db.nexgen.com>, freebsd-questions@freebsd.org
Subject:   Re: newsyslog/rotatelog
Message-ID:  <200203111851.g2BIpC39017110@catflap.bishopston.net>
In-Reply-To: <001301c1c30e$d4006a40$faa0b542@noc>
References:  <001301c1c30e$d4006a40$faa0b542@noc>

next in thread | previous in thread | raw e-mail | index | archive | help
In muc.lists.freebsd.questions, you wrote:
 
> i'm trying to find best way to rotate my apache's logs
> i found small utility that comes with apache

> the only problem with this software is it creates some weird file names
> log.64645645 and god knows what those numbers means..

I've written a wee patch to the rotatelogs program which produces filenames
of the form  <whatever>.YYYY-MM

e.g. access.log.2002-02

You may have it if you want (mail me direct) - I can hack it to chnage
logs daily or weekly if you would prefer.. I've been running this program
with no problems for about 2 years, and outputs from "lsof" confim that
logs are being closed and opened correctly.

As for using newsyslog, it can be problematic (depending on your servers
importance)

When you sigHUP apache, to get it to reset its log files, it kills its
child processes - in other words, all current connections will be broken,.
This will probably be unnoticed for loading small web pages, but if someone
is 1hour into a big download via a modem, they may get annoyed!

You can send a SIGUSR1 to apache instead, which will do a "graceful"
shutdown.. i.e. each child process will only close and reset when its
finished with its current connection -- the problem with log files though,
is again, if a long download is being done, the old file will be open
until its finished - therefore you cant really guess how long things will
take to reset!

For these reasons, a piped program like "rotatelogs" is the best solution
on a heavy server.

cheers,
jamie

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200203111851.g2BIpC39017110>