From owner-freebsd-questions Mon Mar 11 10:51:29 2002 Delivered-To: freebsd-questions@freebsd.org Received: from catflap.bishopston.net (catflap.bishopston.net [24.67.16.239]) by hub.freebsd.org (Postfix) with ESMTP id 761B637B405 for ; Mon, 11 Mar 2002 10:51:22 -0800 (PST) X-Envelope-From: jamie@catflap.bishopston.net X-Envelope-To: freebsd-questions@freebsd.org Received: from catflap.bishopston.net (jamie@localhost [127.0.0.1]) by catflap.bishopston.net (8.12.1/8.12.1) with ESMTP id g2BIpDWv017113; Mon, 11 Mar 2002 18:51:13 GMT (envelope-from jamie@catflap.bishopston.net) Received: (from jamie@localhost) by catflap.bishopston.net (8.12.1/8.12.1/Submit) id g2BIpC39017110; Mon, 11 Mar 2002 18:51:12 GMT (envelope-from jamie) From: Jamie Jones Message-Id: <200203111851.g2BIpC39017110@catflap.bishopston.net> To: "alexus" , freebsd-questions@freebsd.org Subject: Re: newsyslog/rotatelog In-Reply-To: <001301c1c30e$d4006a40$faa0b542@noc> References: <001301c1c30e$d4006a40$faa0b542@noc> X-newsgroup: muc.lists.freebsd.questions Date: Mon, 11 Mar 2002 18:51:12 +0000 Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG 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 .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