Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 05 Mar 2007 17:26:16 -0600
From:      Peter Pluta <peter@placidpublishing.net>
To:        David Robillard <david.robillard@gmail.com>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: Apache Rotate Logs and Log Rotate.
Message-ID:  <45ECA718.5090908@placidpublishing.net>
In-Reply-To: <226ae0c60703051152h183fca79k470d2b064d871ccf@mail.gmail.com>
References:  <226ae0c60703051056ofb18dffu1ea0b9d48297b0bf@mail.gmail.com>	 <45EC6BF3.9090606@placidpublishing.net> <226ae0c60703051152h183fca79k470d2b064d871ccf@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Gotcha, do you use a script to compress the logs after the SIGUSR1 and 
after waiting for a bit for apache to clear it's logging buffer (to not 
have missing logs)?

David Robillard wrote:
> On 3/5/07, Peter Pluta <peter@placidpublishing.net> wrote:
>> Thanks, David. I had already configured it like that the first time
>> around after reading up on it a bit. Most articles/tips I have read say
>> to wait 10 minutes or so and then compress the logs with a shell script
>> in order to be sure Apache finished logging to the files. Another thing,
>> just to be sure. If I had 30 vhosts on my server and each had logs in
>> their home directory, I would still use newsyslog to rotate and delete
>> them, correct? I assume one needs tons of disk space to do that if the
>> sites are rather large.
>
> Well, if you do use newsyslog to rotate Apache log files, then it's
> just a matter of setting the number of files you whish to keep. From
> newsyslog.conf(5)
>
>  count   Specify the maximum number of archive files which may exist.
>          This does not consider the current log file.
>
> Let's say you rotate your files once they reach 2Mb for example and
> that you've configured 10 in your newsyslog,conf <count> field. Then
> that means a maximum of 10 x 2Mb = 20Mb will be kept for one
> VirtualHost. Now if you have 100 virtual hosts all configured this
> way, then you will need 100 x 20Mb = 2000Mb or 2Gb for all your Apache
> logs.
>
> Considering today's disk drive sizes are well beyond the 300Gb, I
> don't think this is a problem at all.
>
> Of course, YMMV so check your own needs and do the math.
>
> Cheers,
>
> David




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