-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

All,

Amazingly enough, I had my first need to use AccessLogValve today, and
one of the things I wanted to print was the user's session id. No,
problem: just add "%S" to the log pattern.

Well, there is one problem: you can't spit-out the session id for logout
requests because the logic for the AccessLogValve is:

if(enabled)
   invoke next valve
   print log message
else
   invoke next valve

Note that the request has essentially completed when the log message is
generated. This makes complete sense as you typically want to log
/after/ the request so you can do things like find out how many bytes
were sent, how long the request took, etc.

In my case, I want to have access to the session id before the session
is invalidated (which happens in the logout servlet).

Another option would be to get the requested session id from the request
(which can only be done with the current AccessLogValve if the client is
using cookies), though that can be misleading because anyone can request
anything... it's not guaranteed to use a useful value.

Anyhow, I was wondering if anyone had any suggestions short of heavily
modifying the AccessLogValve or developing something from scratch.

I'd also be happy to provide a patch for the AccessLogValve that add any
or all of the following capabilities:

1. Allow log before or after request (or both?)
2. Add requested session id to standard pattern options (%Sr?)
or
3. Add %{xxx}rm to call ServletRequest.xxx and print the result
   (allows ${getRequestedSessionId}rm

Any comments?

Thanks,
- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkr93D0ACgkQ9CaO5/Lv0PCLuwCeLq+sIqkfrAgDNmW5i1JECVzz
oTwAnRDS6E7oZIRDQEwtzptBKHDju4Op
=rrdK
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to