Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 04 Aug 2013 11:54:11 +0100
From:      Frank Leonhardt <frank2@fjl.co.uk>
To:        freebsd-questions@freebsd.org
Subject:   Re: Archiving a log file
Message-ID:  <51FE32D3.3000707@fjl.co.uk>
In-Reply-To: <37485629-94BD-48EF-B7A7-9ED4C5B9A6E5@olivent.com>
References:  <51FD8E19.90403@fjl.co.uk> <37485629-94BD-48EF-B7A7-9ED4C5B9A6E5@olivent.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On 04/08/2013 04:04, mikel king wrote:
> On Aug 3, 2013, at 7:11 PM, Frank Leonhardt <freebsd-doc@fjl.co.uk> wrote:
>
>> The answer isn't (AFAIK) newsyslog
>>
> I did some more digging on the whole log piping thing and apache includes a nifty little application called rotatelogs which lives in /usr/local/sbin/rotatelogs on my system that I built form the ports. From the man page:
>
> NAME
> 	 rotatelogs - Piped logging program to rotate Apache logs
> SYNOPSIS
> 	rotatelogs [ -l ] [ -f ] logfile rotationtime|filesizeM [ offset ]
> SUMMARY
> 	rotatelogs is a simple program for use in conjunction with Apache's piped logfile feature. It supports rotation based on a time interval or maximum size of the log.
>
> It looks pretty simple to use just create your log format directive like:
>
> 	LogFormat "%t \"%r\" %>s \"%{Referer}i\" %b" SpecialFormat
>
> 	CustomLog "| /usr/local/sbin/rotatelogs /var/log/httpd-access.log 86400" SpecialFormat
>
> I hope that helps. I know I shall be experimenting with this one tomorrow.
>

Thanks for looking at it, but I probably shouldn't have picked Apache as 
an example. I thought it would be something people were familiar with. 
The program writing the log is actually called flubnutz and it doesn't 
play nice with newsyslog, reopen handles on a signal or anything else. 
FWIW I've been using newsyslog since 1998 from most regular system 
services and I don't have any problem with it.

(I lied about it being called "flubnutz", before anyone Googles it - but 
it's not an Apache-specific issue, as Apache logs are handled well 
enough with newsyslog except where you're running virtual hosts with 
their own log files, in which case it's a PITA.).

Regards, Frank.




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