newsyslog.conf and Apache log files

Robert Huff roberthuff at rcn.com
Thu Oct 7 20:08:27 UTC 2010


Joe Auty writes:

>  I have the following entry for dealing with my Apache log files:
>  
>  /var/log/httpd/*             644  2     *  $M1D0 GBJ   
>  /var/run/httpd.pid 30
>  
>  Unfortunately, this has created these big long log files such as the
>  following:
>  
>  httpderror_log.2.bz2.2.bz2.2.bz2.1.bz2.1.bz2.1.bz2.0.bz2
>  
>  How can I prevent these dumb log file names from being created?

	My advice would be to not use syslog.  It's bee a while since I
fixed this problen, but I remember reading Apache has ... issues
... with rotating logs using syslog/newsyslog.  Instead I use
sysutils/cronolog with:

ErrorLog "|/usr/local/sbin/cronolog  /var/log/httpd-errors.%Y-%m.log"
TransferLog  "|/usr/local/sbin/cronolog  /var/log/httpd-access.%Y-%m.log"

	in httpd.conf.  This gets me:

-rw-r--r--   1 root    wheel       11504 Dec 28  2009 httpd-access.2009-12.log
-rw-r--r--   1 root    wheel        6380 Feb  3  2010 httpd-access.2010-02.log
-rw-r--r--   1 root    wheel        1390 Mar 11  2010 httpd-access.2010-03.log
-rw-r--r--   1 root    wheel        1439 Apr 23 16:06 httpd-access.2010-04.log
-rw-r--r--   1 root    wheel      904451 May 30 10:52 httpd-access.2010-05.log
-rw-r--r--   1 root    wheel       20279 Jun 29 12:29 httpd-access.2010-06.log
-rw-r--r--   1 root    wheel     1586153 Jul 28 07:50 httpd-access.2010-07.log
-rw-r--r--   1 root    wheel      164305 Aug 31 18:51 httpd-access.2010-08.log
-rw-r--r--   1 root    wheel       14294 Sep  9 08:19 httpd-access.2010-09.log
-rw-r--r--   1 root    wheel     3093989 Sep  9 08:19 httpd-access.log
-rw-r--r--   1 root    wheel       71655 Oct  7  2009 httpd-error.log
-rw-rw-r--   1 root    wheel        3574 Oct  7  2009 httpd-errors.2009-10.log
-rw-r--r--   1 root    wheel        1827 Nov 30  2009 httpd-errors.2009-11.log
-rw-r--r--   1 root    wheel        1827 Jan 17  2010 httpd-errors.2010-01.log
-rw-r--r--   1 root    wheel        5027 Feb  3  2010 httpd-errors.2010-02.log
-rw-r--r--   1 root    wheel       10562 Mar 25  2010 httpd-errors.2010-03.log
-rw-r--r--   1 root    wheel        5471 Apr 23 16:05 httpd-errors.2010-04.log
-rw-r--r--   1 root    wheel      332035 May 30 10:52 httpd-errors.2010-05.log
-rw-r--r--   1 root    wheel       10817 Jun 29 12:29 httpd-errors.2010-06.log
-rw-r--r--   1 root    wheel      569109 Jul 28 07:50 httpd-errors.2010-07.log
-rw-r--r--   1 root    wheel       59928 Aug 31 18:51 httpd-errors.2010-08.log
-rw-r--r--   1 root    wheel        5198 Sep  9 08:19 httpd-errors.2010-09.log

	in /var/log.


					Robert Huff



More information about the freebsd-questions mailing list