You are viewing a plain text version of this content. The canonical link for it is here.
Posted to apache-bugdb@apache.org by Noor Dawod <no...@comrax.com> on 1999/12/26 10:00:56 UTC

mod_log-any/5510: The Custom Log format directive %...{FOOBAR}e is acting different than requested

>Number:         5510
>Category:       mod_log-any
>Synopsis:       The Custom Log format directive %...{FOOBAR}e is acting different than requested
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    apache
>State:          open
>Class:          sw-bug
>Submitter-Id:   apache
>Arrival-Date:   Sun Dec 26 01:10:00 PST 1999
>Last-Modified:
>Originator:     noor@comrax.com
>Organization:
apache
>Release:        1.3.9
>Environment:
FreeBSD dns.comrax.com 3.3-STABLE FreeBSD 3.3-STABLE #4: Tue Sep 28 23:08:40 IST 1999     root@dns.comrax.com:/usr/src/sys/compile/WWW  i386
>Description:
In httpd.conf, if you declare a new Custom Log format, let's say called 'foobar', like this:

LogFormat "%h %l %u %t \"%{REQUEST_METHOD}e /newdirectory/%{REQUEST_URI}e\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" foobar

Then, you try to access a page, let's say 'index.html' which has 5 inline images, that the browser needs to send subsequent GET requests to the server to retrieve them. You can see that in the first request (to index.html), the log file logs:

192.168.80.80 - - [26/Dec/1999:10:34:07 +0200] "GET /newdirectory/index.html HTTP/1.0" 200 2300 "-" "Mozilla/4.5 [en] (Win95; I)"

but, in the subsequent 5 requests to the images, each line in the log  shows:

192.168.80.80 - - [26/Dec/1999:10:34:07 +0200] "- /newdirectory/- HTTP/1.0" 200 7852 "-" "Mozilla/4.5 [en] (Win95; I)"

Notice the "-" dashes instead of the environment variables 'REQUEST_METHOD' and 'REQUEST_URI' that were inserted in the Custom Log format.

>How-To-Repeat:
Define a new Custom Log format like this:

LogFormat "%h %l %u %t \"%{REQUEST_METHOD}e /newdirectory/%{REQUEST_URI}e\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" foobar

Then, build a simple index.html that loads another 2 inline images. Build a new VirtualHost and log the requests based on the new Custom Log 'foobar' format. Then try to fetch the the index.html file, and watch the two other requests for the images.

If this doesn't show, just hit 'Reload' and watch.
>Fix:
No, no suggesstions. But I think the normal behavior would be to show the requests, the REQUEST_STRING and the REQUEST_URI for each request to the server.
>Audit-Trail:
>Unformatted:
[In order for any reply to be added to the PR database, you need]
[to include <ap...@Apache.Org> in the Cc line and make sure the]
[subject line starts with the report component and number, with ]
[or without any 'Re:' prefixes (such as "general/1098:" or      ]
["Re: general/1098:").  If the subject doesn't match this       ]
[pattern, your message will be misfiled and ignored.  The       ]
["apbugs" address is not added to the Cc line of messages from  ]
[the database automatically because of the potential for mail   ]
[loops.  If you do not include this Cc, your reply may be ig-   ]
[nored unless you are responding to an explicit request from a  ]
[developer.  Reply only with text; DO NOT SEND ATTACHMENTS!     ]