From owner-freebsd-questions@FreeBSD.ORG Wed Nov 8 20:10:29 2006 Return-Path: X-Original-To: questions@freebsd.org Delivered-To: freebsd-questions@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9DAE816A407 for ; Wed, 8 Nov 2006 20:10:29 +0000 (UTC) (envelope-from Steve@nurserysupplies.com) Received: from netsrv.nurserysupplies.com (oh-65-40-136-8.sta.embarqhsd.net [65.40.136.8]) by mx1.FreeBSD.org (Postfix) with ESMTP id EF99443D4C for ; Wed, 8 Nov 2006 20:10:28 +0000 (GMT) (envelope-from Steve@nurserysupplies.com) Received: from ASSP (spamfilter.nsi.local [10.1.0.31]) by netsrv.nurserysupplies.com (8.12.9p2/8.12.9) with ESMTP id kA8K9Oi6081149 for ; Wed, 8 Nov 2006 15:09:39 -0500 (EST) (envelope-from Steve@nurserysupplies.com) Received: from 10.1.0.1 ([10.1.0.1] helo=wilee.nsi.local) by ASSP ; 8 Nov 06 20:08:11 -0000 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Date: Wed, 8 Nov 2006 15:08:06 -0500 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Apache log rotation question... Thread-Index: Acb/hFMXxF4gCiP7TJ2Bt0TG0bsMYgD6VULg From: "Brown, Steve" To: Cc: Subject: RE: Apache log rotation question... X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Nov 2006 20:10:29 -0000 I am using cronolog to handle the logging end of apache. Cronolog = basically takes care of the logging for apache, allowing you much more = flexibility with the logging options. =20 Assuming.. 1. You have cronolog installed 2. /path/to/your/logs/vhost1/ is a valid path A sample Apache config line would read (main or virtual host context): ErrorLog "|cronolog /path/to/your/logs/vhost1/%Y%m%d_error.log" CustomLog "|cronolog /path/to/your/logs/vhost1/%Y%m%d_access.log" = combined I this example, you will generate logs with the names 20061108_error.log = and 20061108_access.log respectively and each day (midnight server time) = cronolog will auto-gen new ones as soon as apache sends it something to = log. Using this method, cronolog is doing the logging for Apache = specifically the way when where and how you want it negating the need = for further scripting and manipulating of the logs afterward. Hope that helps. Steve -----Original Message----- From: owner-freebsd-questions@freebsd.org [mailto:owner-freebsd-questions@freebsd.org]On Behalf Of Philip Hallstrom Sent: Friday, November 03, 2006 3:21 PM To: Curtis Jewell Cc: questions@freebsd.org Subject: Re: Apache log rotation question... > I'm wondering if I can safely use newsyslog with a newsyslog.conf with = these=20 > lines in it: I don't know the answer to your question, but you might look at=20 cronolog... http://www.freebsd.org/cgi/url.cgi?ports/sysutils/cronolog/pkg-descr > > /var/log/httpd/access_log/* 644 1 * $W0D0 G > /var/log/httpd/error_log/* 644 1 * $W0D0 G > /var/log/httpd/ssl_request.log 644 1 * $W0D0 > /var/log/httpd/error.log 644 1 * $W0D0 > # After this point should be one line... > /var/log/httpd/access.log 644 1 * $W0D0 -=20 > /var/run/httpd.pid 30 > > or if not, what should I do instead? > > (I have 4 separate vhosts that keep their access logs in the first 2=20 > directories) > > For the record, I want weekly rotation on Sundays at midnight (I = assume JST,=20 > since I have my time set to local time, which is JST [GMT+9, no DST]), = > keeping 1 log, (the way I read the fine manuals, I'll have to have a = cron job=20 > bzip2 it up later and move it aside if I want to keep more and/or = compress=20 > them) permissions 644 with the owner being root:wheel, no size check, = and the=20 > last part of the last line should send a SIGUSR1 (30) signal to = Apache, which=20 > should do the equivalent of a 'apachectl -k graceful' per=20 > http://httpd.apache.org/docs/2.2/stopping.html. > > My question really is, does newsyslog send the signal at the right = time=20 > [after the rotation is done, per=20 > http://httpd.apache.org/docs/2.2/logs.html#rotation] and does it do = the lines=20 > in order???) > > - --Curtis > > - -- Curtis Jewell > swordsman@csjewell.fastmail.us > > "Killed enough? ... Yes, Your Highness, I think we all have." > --John Patrick Ryan (from 'The Sum Of All Fears', Tom Clancy) > > [I use Pine, which deliberately does not display colors and pictures > in HTML mail] > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.5 (FreeBSD) > > iD8DBQFFS6ByvCi+150VKIMRAs6PAKDOOvnARxXKUTY5dvNrob3gl9+aZACdG+P+ > Uz0GrVe1p5MNuRPwiTbBXxY=3D > =3DlTB2 > -----END PGP SIGNATURE----- > _______________________________________________ > freebsd-questions@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-questions > To unsubscribe, send any mail to = "freebsd-questions-unsubscribe@freebsd.org" > _______________________________________________ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to = "freebsd-questions-unsubscribe@freebsd.org"