Hello. Line 109 of apache2splitlogfile has an error. Lines 108 and 109 are as follows: open LOGFILE, ">>$filename" or die ("Can't open $logs/$filename"); Line 109 should just say "Can't open $filename"; it should not include "$logs" in the string. This is because of line 104, which reads: $filename="$logs/VLOG-$date-${vhost}.log"; See? $logs is already part of $filename. As a result, my error log has paths in it which are confusing, because the directory part is printed twice. This perhaps leads me to incorrect conclusions about the source of my misconfiguration. I submitted this bug to the Apache group but they informed me that the Gentoo team has made these modifications to the file, so I am submitting the bug report to you. Here's the original one I filed with Apache: http://issues.apache.org/bugzilla/show_bug.cgi?id=28500 Reproducible: Always Steps to Reproduce: 1. 2. 3.
Are you using the standard error_logs? Also submitting a patch would be great. Thanks zul
Never mind I see where you are coming from. Fixed in cvs. Thanks for the bug report. chuck
The bug does not appear to have been fixed. We have Apache 2.0.50 and the file still has the problem described in this report. I will attach a diff with which you can fix it.
Created attachment 35803 [details, diff] tiny patch to fix this bug
i fixed that in our svn overlay
ok, this is now in portage
This bug is still alive. I installed a fresh Gentoo, Apache2 in August 2005 and it has this problem. open LOGFILE, ">>$filename" or die ("Can't open $logs/$filename"); Should be: open LOGFILE, ">>$filename" or die ("Can't open $filename"); Also, as is, it doesn't die very gracefully. I recommend changing it to this: open (LOGFILE, ">>$filename") or die ("Can't open $logs/$filename"); Occasionally I get a problematic log entry that will result in a $logs equal to "-", causing this script to fail. The only way I can reproduce it reliably is to use a mod_rewrite redirect. I have included another line in this script to handle these anomolies: if($logs eq "-") {$logs="/var/log/apache2";} right after the similar existing line: if($logs eq "") {$logs="/var/log/apache2";} as the comments say: "caution rocks"
(In reply to comment #7) > This bug is still alive. I installed a fresh Gentoo, Apache2 in August 2005 and > it has this problem. > > open LOGFILE, ">>$filename" > or die ("Can't open $logs/$filename"); > > Should be: > > open LOGFILE, ">>$filename" > or die ("Can't open $filename"); > > Also, as is, it doesn't die very gracefully. I recommend changing it to this: > > open (LOGFILE, ">>$filename") > or die ("Can't open $logs/$filename"); > > Occasionally I get a problematic log entry that will result in a $logs equal to > "-", causing this script to fail. The only way I can reproduce it reliably is to > use a mod_rewrite redirect. I have included another line in this script to > handle these anomolies: > > if($logs eq "-") {$logs="/var/log/apache2";} > > right after the similar existing line: > > if($logs eq "") {$logs="/var/log/apache2";} > > as the comments say: "caution rocks" In addition, I've seen some replacement scripts to this one that close the logfile when finished, would this help? Like: http://files.l8nite.net/apache2_splitlog/apache2_splitlog.txt