Andrew Lau ([EMAIL PROTECTED]) said something to this effect on
04/04/2001:
> I am currently developing a Perl based apache module and was
> wondering if such a functionality was available. From within
> the module would it be possible to modify the request object so
> that the url that gets logged to the access.log is different
> from what the client actually requested?
>
> For example, if a client requested /file which was redirected
> to this module could it modify either the request object or
> some apache internal so that it gets written in the access log
> as /file?session=1234567890abcdef .
>
> I apologize if this is readily available from some FAQ as i
> have been unable to find this information. Thanks for your
> time.
This is untested, but I believe that mod_log_config logs, as part
of the %r CustomLog directive, r->the_request, which is the first
line of the request (i.e., "GET /file HTTP/1.0"). It might be
possible to do something like:
my @request = split / /, $r->the_request;
$request[1] = sprintf "%s?session=%s", $request[1], $r->param('session');
$r->the_request(join ' ', @request);
assuming that $r->the_request is not read-only.
Another option is to use CustomLog to log something other than
%r, like %{session}e to log an environment variable, or %q to log
the query string:
CustomLog "%h %l %u %t \"%m %U%q %H\" %>s %b"
%m is the method, %U is the requested url, %q is the query
%string (or '' if no query string), %H is the request protocol.
(darren)
--
Everybody wants to go to heaven, but nobody wants to die.