Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 9 May 2016 18:20:00 -0600
From:      markham breitbach <markham@ssimicro.com>
To:        "freebsd-questions@freebsd.org" <freebsd-questions@freebsd.org>
Subject:   Re: file receives no input after turn over by newsyslog(8)
Message-ID:  <278899ea-8fc0-4898-2e38-0bca2009e45f@ssimicro.com>
In-Reply-To: <20160509222703.GA2794@SDF.ORG>
References:  <20160509222703.GA2794@SDF.ORG>

next in thread | previous in thread | raw e-mail | index | archive | help
The problem here is that httpd opens a file handle and keeps it open for
the log, so after it is rotated, the file handle follows the old file.
(you should still see entries showing up in the log.0).

There are many articles written about this, but the idea is you need to
send apache a signal to release the file handle and start writing to the
new log.  This is the first page that comes up in google:

http://mikkel.hoegh.org/2009/10/08/rotating-apache-httpd-logfiles-freebsd/

-M

On 2016-05-09 4:27 PM, Cary wrote:
> Hi all,
>
> Perhaps someone might be able to help.
> The /var/log/httpd-access.log file is turned over at least
> once a week on a VPS running 10.2-Stable.  
>
> /var/log/httpd-*.log                    644  10    500  *     GX
>
>  is the line I have in /etc/newsyslog.conf.
>
> After the file is turned over no messages are saved from the apache24
> daemon.  There is just a line from newsyslog(8) with the date, hostname
> process number and a message that the file was turned over. 
>
> After restarting httpd(8) all messages are logged again.
> Other httpd-* log files are do not fill up as quickly, but are
> probably affected as well.  How can I keep getting logs from
> the server without a service restart?
>
>




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?278899ea-8fc0-4898-2e38-0bca2009e45f>