You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Rodney Broom <mo...@rbroom.com> on 2001/10/19 19:04:38 UTC
Selectively writing to the access log
I'm wanting to look at the request and optionally change what gets written to the access log. However, I only see methods for writing to the error log. I think I need to do this inside the request because I'm piping things with TransferLog and don't want to interupt that. But I don't mind another aproach.
---
Rodney Broom
Re: Selectively writing to the access log
Posted by Rob Nagler <na...@bivio.net>.
> Usage: Apache::the_request(r)
This means the "sub" Apache::the_request takes a single parameter,
i.e. you can't modify the_request.
You can modify the method and uri. You can't modify the protocol
(HTTP/1.0). If you change method or uri, it doesn't change "the_request".
You can change your LogFormat to get these values--see
http://httpd.apache.org/docs/mod/mod_log_config.html
Rob
Re: Selectively writing to the access log
Posted by Rodney Broom <mo...@rbroom.com>.
From: Rob Nagler <na...@bivio.net>
> I don't think you can change the access log format, but you can
> modify the values. For example, you can set $c->user and $c->remote_ip.
Thanks Rob, this is helpful and it works. The value I'm wanting to change is in r->the_request, but passing a value to that method yeilds a usage message:
Usage: Apache::the_request(r)
This routine returns a string, so I assumed it would take a string. I've tried passing other things always getting the same message. I've glanced at mod_log_conf.c, and some core code, but I don't see what I need to pass.
---
Rodney Broom
Re: Selectively writing to the access log
Posted by Rob Nagler <na...@bivio.net>.
> I only see methods for writing to the error log.
I don't think you can change the access log format, but you can
modify the values. For example, you can set $c->user and $c->remote_ip.
Rob