In modperl 1.99 I used to use the code below to append a bunch of parameters to the log entry for a request.

Example: A request to /handler?client=demo would be written to the log as: (notice how sysinfo has been appended to the log)

fios.verizon.net - - [09/Jan/2007:16:39:17 -0500] "GET /handler?client=demo&sysinfo=servtime%3D3.976863 HTTP/1.1" 200 1893 "-" "Mozilla/5.0 Firefox/1.0.6 (ax)" 4098034 -

sub append_to_log {
 my ($r, $plog) = @_;
 my $uri = "";
 if ($r->the_request =~ / (.*) /) {
   $uri = $1;
 } else {
   return;
 }
 my $info = "&sysinfo=" . uri_escape(join("&", @{$plog}));
 (my $request_line = $r->the_request) =~ s/ (.*) / $uri$info /;
 $r->the_request($request_line);
}

Problem is: In Modperl 2.0+, the method the_request suddenly became read-only and the code stopped working.

From: http://search.cpan.org/dist/mod_perl/Changes
Apache::RequestRec methods changes [Stas] - readwrite => readonly:

   connection, canonical_filename, header_only, main, next, prev,
   pool, per_dir_config, request_config, proto_num, protocol,
   request_time, server, the_request, unparsed_uri


Can anyone suggest an alternate way of modifying the log entry ? In other words, what way does MP2 allow for us to control what gets logged to the Apache access_log ?

Alternatively: Can the_request in Apache::RequestRec be made writable again so that it works like before ?

Any help is really appreciated. Thanks.

--
Alden DoRosario
CTO
Chitika, Inc.
www.chitika.com



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to