httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter W <pet...@usa.net>
Subject Re: [PATCH] mod_log_config: expose r->protocol, r->method
Date Mon, 27 Sep 1999 23:35:23 GMT
Adam,

You're right that the ? is only a delimiter; obviously I'm more concerned
about making a normal-looking log for analysis packages, especially
closed-source ones, so I'd prefer the ? to be prepended. A LogFormat
shortcut without the ? would mean adding a ? in the LogFormat, which might
upset some of these tools if Apache logged uri's with trailing ? but no
query string data. 

Does it make sense to add _two_ shortcuts,
	%q == "" || "?" + r->args	/* traditional %r content */
	%Q == "-" || r->args		/* for logging separately? */
or is that treading on code-bloat? If two is too many, well, which is
preferable? I honestly don't have any use for the more "correct" shortcut,
even if it is more precise and faster/cleaner to code (e.g. no
ap_strcat() needed).

I'd like to hear from anyone (off-list?) who has had success with the
documented %{FOOBAR}e shortcut. I would have expected that to allow
something like %{QUERY_STRING}e to do what Adam wants, but I have had no
luck with %{...}e at all. 

Thanks,

-Peter

At 6:21pm Sep 27, 1999, Adam M Donahue wrote:

> I would not include the question mark as part of the query string.  If
> your intention is to reconstruct the URL in the log, then you should place
> the question mark in there specifically.  According to rfc2396, the query
> component doesn't include the question mark; instead the mark is used as a
> delimiter.

> > Very good point. For this application, we didn't need to record the query
> > string, but I had also forgotten about it. Hmmm, how about %q for
> > query_string, generated by
> > 
> > static const char *log_query_string(request_rec *r, char *a) 
> > {
> > 	return (r->args != NULL) ? ap_pstrcat(r->pool, "?", r->args, NULL)
> > 				: "";
> > }
> > 
> > so that "%m %U%q %H"  == "%r", and the logging module would prepend "?" if
> > there was data, or log an empty char (i.e., nothing) if no query_string.
> > 
> > -Peter
> > 
> > At 12:39pm Sep 27, 1999, Spidaman The Defenestrator wrote:
> > 
> > > The full request line would have the uri and the query string so having a
> > > log format that has "%m %U %H" would not replace %r, right?
> > > 
> > > Meanwhile, back at the ranch...
> > > > For a recent project, we wanted to customize the log format and realized
> > > > that while %r refers to the full request line and %U refers to the uri,
> > > > there was no good way to refer to the method or protocol. 
> > 
> > > > 	%m => r->method		(mnemonic: "m" for "method")
> > > > 	%H => r->protocol	(mnemonic: "H" begins "HTTP/1.0")
> > 
> > 
> > 
> > 
> 

The Intel Pentium III chip: designed to deny your privacy 
Boycott Intel. http://www.privacy.org/bigbrotherinside/




Mime
View raw message