On Sun, 26 Sep 1999, Clinton Gormley wrote:
> I would like to set a session ID in a module, and then record that ID in
> my access log.
>
> I am setting the environment variable in a PerlAccess Handler by doing
> this :
> $r->subprocess_env('TICKET'=>$SID);
>
> and I try to log it using
> .....%{TICKET}e...., but nothing is recorded - it's always blank, but I
> can see the environment variable has been set when in the module which
> called the ticket module.
it works fine for me, I test with:
httpd.conf:
PerlAccessHandler My::Access
PerlLogHandler My::Log
startup.pl:
sub My::Access::handler {
my $r = shift;
$r->subprocess_env(TICKET => $$);
$r->notes(TICKET => $$);
}
sub My::Log::handler {
my $r = shift;
my $env = $r->subprocess_env('TICKET');
my $note = $r->notes('TICKET');
warn "env=$env, note=$note\n";
}
adding %{TICKET}e and %{TICKET}n to the LogFormat for access_log works
fine too. does this simple test work for you?
-Doug