We use the notes table to put a reference to the session (and thus the user)
in the access log.

$request->notes->set('session' => $session->{SESSION});

This is in apache2.conf:

  LogFormat "%v:%p %h %l %u %t \"%r\" %>s %b \"%{Referer}i\"
\"%{User-Agent}i\" %{session}n" combined_with_session

This makes it possible to differentiate log entries by user, whether
multiple users have the same ip address or if a user's address changes.



On Tue, Mar 23, 2010 at 4:28 PM, Michael Ludwig <mil...@gmx.de> wrote:

> Let me bore you some more.
>
> First, ModPerl::MethodLookup::lookup_method( $symbol ) is a really great
> help for exploring the API!
>
> m...@colinux:~ > perl aplkp.pl notes
> There is more than one class with method 'notes'
> try one of:
>        use Apache2::RequestRec ();
>        use Apache2::Connection ();
>
> m...@colinux:~ > perl aplkp.pl pnotes
> There is more than one class with method 'pnotes'
> try one of:
>        use Apache2::RequestUtil ();
>        use Apache2::ConnectionUtil ();
>
> Good. Now to the point. We have ->notes and ->pnotes on the request and
> connection objects. I've passed some information from mod_perl on to
> mod_php5 using the notes table. Cool. I could pass complex data from one
> mod_perl handler to the other using the pnotes table. Also cool.
>
> It's all in-process, which is cool. It's all per-request (or, if you
> want, per-connection), which sets the scope of its usefulness.
>
> The notes are an APR::Table, the pnotes are a HASH.
>
> What real-life uses have you found for these notes and pnotes?
>
> What could be done at the connection level? Or is this rather too
> low-level for run-of-the-mill web applications?
>
> This is by curiosity and to get my imagination going.
> --
> Michael Ludwig
>

Reply via email to