newsyslog.conf and Apache log files
Hello, 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? -- Joe Auty, NetMusician NetMusician helps musicians, bands and artists create beautiful, professional, custom designed, career-essential websites that are easy to maintain and to integrate with popular social networks. www.netmusician.org http://www.netmusician.org j...@netmusician.org mailto:j...@netmusician.org ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
Re: newsyslog.conf and Apache log files
Joe Auty j...@netmusician.org writes: Hello, 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? Don't use wildcards in newsyslog.conf. What's happening is httperror_log.2.bz2 gets rotated into httperror_log.2.baz2.1.bz2, because it matches the filename glob you specified. ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
Re: newsyslog.conf and Apache log files
On 10/7/10 7:26 PM, Joe Auty wrote: Hi Joe, 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? Like Lowell wrote, don't use wildcards in newsyslog.conf. :-) I just react to this, because I spent quite some time after a storage change on why my machine was hanging at bootup on the newsyslog trimming and creating logfiles line. There was no good Google result that pointed me in the direction, hence my post now. In my case I made the same mistake as you on my Asterisk logfiles (which also don't have any extention). So after troubleshooting NFS and filesystem problems, I ran truss on newsyslog and found out about the nice tree newsyslog had built on my Asterisk logfiles. It wasn't hanging afterall, it was quite busy. :-) I just wrote three lines with the three filenames I wanted to rotate and since then it's fine. /Robin ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
Re: newsyslog.conf and Apache log files
Lowell Gilbert wrote: Joe Auty j...@netmusician.org writes: Hello, 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? Don't use wildcards in newsyslog.conf. What's happening is httperror_log.2.bz2 gets rotated into httperror_log.2.baz2.1.bz2, because it matches the filename glob you specified. Aha! That makes sense... What alternatives are there then so that I don't have to type in log file paths for each of my virtually hosted domains? How about: /var/log/httpd/*_log would this work? -- Joe Auty, NetMusician NetMusician helps musicians, bands and artists create beautiful, professional, custom designed, career-essential websites that are easy to maintain and to integrate with popular social networks. www.netmusician.org http://www.netmusician.org j...@netmusician.org mailto:j...@netmusician.org ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
newsyslog.conf and Apache log files
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 rootwheel 11504 Dec 28 2009 httpd-access.2009-12.log -rw-r--r-- 1 rootwheel6380 Feb 3 2010 httpd-access.2010-02.log -rw-r--r-- 1 rootwheel1390 Mar 11 2010 httpd-access.2010-03.log -rw-r--r-- 1 rootwheel1439 Apr 23 16:06 httpd-access.2010-04.log -rw-r--r-- 1 rootwheel 904451 May 30 10:52 httpd-access.2010-05.log -rw-r--r-- 1 rootwheel 20279 Jun 29 12:29 httpd-access.2010-06.log -rw-r--r-- 1 rootwheel 1586153 Jul 28 07:50 httpd-access.2010-07.log -rw-r--r-- 1 rootwheel 164305 Aug 31 18:51 httpd-access.2010-08.log -rw-r--r-- 1 rootwheel 14294 Sep 9 08:19 httpd-access.2010-09.log -rw-r--r-- 1 rootwheel 3093989 Sep 9 08:19 httpd-access.log -rw-r--r-- 1 rootwheel 71655 Oct 7 2009 httpd-error.log -rw-rw-r-- 1 rootwheel3574 Oct 7 2009 httpd-errors.2009-10.log -rw-r--r-- 1 rootwheel1827 Nov 30 2009 httpd-errors.2009-11.log -rw-r--r-- 1 rootwheel1827 Jan 17 2010 httpd-errors.2010-01.log -rw-r--r-- 1 rootwheel5027 Feb 3 2010 httpd-errors.2010-02.log -rw-r--r-- 1 rootwheel 10562 Mar 25 2010 httpd-errors.2010-03.log -rw-r--r-- 1 rootwheel5471 Apr 23 16:05 httpd-errors.2010-04.log -rw-r--r-- 1 rootwheel 332035 May 30 10:52 httpd-errors.2010-05.log -rw-r--r-- 1 rootwheel 10817 Jun 29 12:29 httpd-errors.2010-06.log -rw-r--r-- 1 rootwheel 569109 Jul 28 07:50 httpd-errors.2010-07.log -rw-r--r-- 1 rootwheel 59928 Aug 31 18:51 httpd-errors.2010-08.log -rw-r--r-- 1 rootwheel5198 Sep 9 08:19 httpd-errors.2010-09.log in /var/log. Robert Huff ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
Re: newsyslog.conf and Apache log files
Joe Auty j...@netmusician.org writes: Lowell Gilbert wrote: Joe Auty j...@netmusician.org writes: Hello, 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? Don't use wildcards in newsyslog.conf. What's happening is httperror_log.2.bz2 gets rotated into httperror_log.2.baz2.1.bz2, because it matches the filename glob you specified. Aha! That makes sense... What alternatives are there then so that I don't have to type in log file paths for each of my virtually hosted domains? How about: /var/log/httpd/*_log would this work? I was going to say I didn't have time to figure it out, but it only took me a couple of minutes of looking at the source to be (*kind of*) sure that your suggestion *will* work. It shouldn't take more than ten minutes to try it out, anyway. If that doesn't work for you, you could always try generating the newsyslog.conf file from a script. Or try one of the several other logfile-rotating programs. But I think your idea should be good. Good luck. ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
Re: newsyslog.conf and Apache log files
On Thu, Oct 7, 2010 at 11:25 AM, Lowell Gilbert freebsd-questions-lo...@be-well.ilk.org wrote: Joe Auty j...@netmusician.org writes: Hello, 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? Don't use wildcards in newsyslog.conf. What's happening is httperror_log.2.bz2 gets rotated into httperror_log.2.baz2.1.bz2, because it matches the filename glob you specified. One alternative might be to use newsyslog's -a option to put the archived logs in a separate directory, where the glob won't find them. Unfortunately there doesn't seem to be a way to define this on a per-file or per-directory basis, so it would apply to *all* your logs. ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
Re: newsyslog.conf and Apache log files
Robert Huff roberth...@rcn.com writes: 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. Those problems were a race condition between (Apache) closing the log file and (newsyslog) opening it to start compression. *How* the log rotation is done isn't really relevant (unless one sends the logs through pipes), but the only safe way is to shut down the server while the rotation is being done. You don't compress your logs, so it wouldn't affect you anyway. Joe does, so it could be an issue for him; the Apache documentation covers a number of options. ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
Re: newsyslog.conf and Apache log files
07.10.2010 20:26, Joe Auty wrote: Hello, 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? /var/log/httpd/*_log would suffice. -- Sphinx of black quartz judge my vow. ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
Re: newsyslog.conf and Apache log files
--On Thursday, October 07, 2010 16:08:23 -0400 Robert Huff roberth...@rcn.com wrote: 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? This is what I use: /var/log/httpd-access.log 640 5 *$W0D04 Z /var/run/httpd.pid /var/log/httpd-error.log640 5 *$W0D00 Z /var/run/httpd.pid /var/log/rewrite_log640 5 *$W0D00 Z /var/run/httpd.pid And this is the results: # ls -lsa /var/log/httpd-* 279520 -rw-r- 1 root wheel 286062450 Oct 7 16:09 /var/log/httpd-access.log 26352 -rw-r- 1 root wheel 26960261 Oct 3 04:00 /var/log/httpd-access.log.0.gz 26720 -rw-r- 1 root wheel 27332026 Sep 26 04:00 /var/log/httpd-access.log.1.gz 37984 -rw-r- 1 root wheel 38845050 Sep 19 04:00 /var/log/httpd-access.log.2.gz 25632 -rw-r- 1 root wheel 26214452 Sep 5 04:00 /var/log/httpd-access.log.3.gz 24800 -rw-r- 1 root wheel 25364090 Aug 29 04:00 /var/log/httpd-access.log.4.gz 23568 -rw-r- 1 root wheel 24116870 Aug 22 04:00 /var/log/httpd-access.log.5.gz 1472 -rw-r- 1 root wheel1477939 Oct 7 16:07 /var/log/httpd-error.log 122 -rw-r- 1 root wheel 124058 Oct 3 00:00 /var/log/httpd-error.log.0.gz 140 -rw-r- 1 root wheel 141619 Sep 26 00:00 /var/log/httpd-error.log.1.gz 224 -rw-r- 1 root wheel 198696 Sep 19 00:00 /var/log/httpd-error.log.2.gz 150 -rw-r- 1 root wheel 153353 Sep 5 00:00 /var/log/httpd-error.log.3.gz 138 -rw-r- 1 root wheel 139720 Aug 29 00:00 /var/log/httpd-error.log.4.gz 114 -rw-r- 1 root wheel 116124 Aug 22 00:00 /var/log/httpd-error.log.5.gz 80 -rw-r--r-- 1 root wheel 80066 Oct 6 18:47 /var/log/httpd-ssl_request.log # ls -lsa /var/log/rewrite_log* 194672 -rw-r- 1 root wheel 199225770 Oct 7 16:07 /var/log/rewrite_log 17856 -rw-r- 1 root wheel 18260862 Oct 3 00:00 /var/log/rewrite_log.0.gz 18448 -rw-r- 1 root wheel 18873604 Sep 26 00:00 /var/log/rewrite_log.1.gz 26288 -rw-r- 1 root wheel 26899244 Sep 19 00:00 /var/log/rewrite_log.2.gz 17536 -rw-r- 1 root wheel 17935781 Sep 5 00:00 /var/log/rewrite_log.3.gz 16896 -rw-r- 1 root wheel 17278330 Aug 29 00:00 /var/log/rewrite_log.4.gz 16048 -rw-r- 1 root wheel 16402215 Aug 22 00:00 /var/log/rewrite_log.5.gz Your problem appears to be caused by file globbing. Since you use httpd/*, every file will be rotated, even ones that were previously rotated. So, newsyslogd keeps appending more and more bzs to the end of the filenames, just as you've told it to do. 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: None here, and I've been rotating apache logs since 1.3.1* (now at 2.2.16 with numerous upgrades in between) using newsyslog without every seeing the problem that you describe. -- Paul Schmehl, Senior Infosec Analyst As if it wasn't already obvious, my opinions are my own and not those of my employer. *** It is as useless to argue with those who have renounced the use of reason as to administer medication to the dead. Thomas Jefferson There are some ideas so wrong that only a very intelligent person could believe in them. George Orwell ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org