You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Jeff Gleixner <gl...@uswest.net> on 2000/04/01 02:02:16 UTC
How do I modify the URI for standard access log?
Ok, simple question. How to I modify the URI that gets logged? I
understand how to write it to a different file and/or to a DBI, I just
want to modify what's written to the standard access log.
I want the URI set to a file that doesn't exist, but in a format that a
log analyser and I can understand and includes info from various dynamic
pieces I'm setting with Mason. I'd like to do this for one
'special.html' file.
I've tried:.
[...]
#important piece of Apache::addToURI
sub handler {
my $r=shift;
return OK if $r->content_type =~/^image/;
return DECLINED if $r->uri !~/special/;
$r->uri("/bubba/gump.html");
return DECLINED; #also tried OK
}
1;
I want "GET /bubba/gump.html" .. to show up in the usual access_log file
as the URI that was served. It goes through the handler, so I have
things set up correctly, it's just that the URI isn't changed. What's
missing?..
Just to be complete.. or if there's something with the way I'm using
PerlLogHandler with Mason.
<Location /mason>
PerlRequire /path/to/handler.pl
DefaultType text/html
SetHandler perl-script
PerlHandler HTML::Mason
PerlRequire /path/to/Apache/addToURI.pm
PerlLogHandler Apache::addToURI
</Location>
Thanks
--
Jeff Gleixner
Seinfeldism of the moment :
Can you be a closet claustrophobic?
Re: How do I modify the URI for standard access log?
Posted by Doug MacEachern <do...@covalent.net>.
the first patch had a copy-n-pasto, this one works fine.
--- src/modules/perl/Apache.xs 2000/04/03 03:11:14 1.90
+++ src/modules/perl/Apache.xs 2000/04/03 04:32:22
@@ -1303,11 +1303,11 @@
RETVAL
char *
-the_request(r)
+the_request(r, ...)
Apache r
CODE:
- RETVAL = r->the_request;
+ get_set_PVp(r->the_request,r->pool);
OUTPUT:
RETVAL
Re: How do I modify the URI for standard access log?
Posted by Doug MacEachern <do...@covalent.net>.
On Fri, 31 Mar 2000, Jeff Gleixner wrote:
> Ok, simple question. How to I modify the URI that gets logged? I
> understand how to write it to a different file and/or to a DBI, I just
> want to modify what's written to the standard access log.
>
> I want the URI set to a file that doesn't exist, but in a format that a
> log analyser and I can understand and includes info from various dynamic
> pieces I'm setting with Mason. I'd like to do this for one
> 'special.html' file.
try the patch below along with something like so:
$r->the_request(join ' ', $r->method, "/bubba/gump.html", $r->protocol);
--- src/modules/perl/Apache.xs 2000/04/03 03:11:14 1.90
+++ src/modules/perl/Apache.xs 2000/04/03 04:24:24
@@ -1303,11 +1303,11 @@
RETVAL
char *
-the_request(r)
+the_request(r, ...)
Apache r
CODE:
- RETVAL = r->the_request;
+ get_set_PVp(r->status_line,r->pool);
OUTPUT:
RETVAL