You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Joseph Hannon <jo...@uiowa.edu> on 2005/09/08 22:21:34 UTC

How would I send log4j dynamic info on each request?

I have a need to send log4j dynamic info during each reqest so that it 
will display the user id of the requestor. I am using log4j's Nested 
Diagnostic Context (NDC) to do this and it seems to work well.

I have hacked this into a Tapestry 3.0.3 application to get it to work 
and would like to know a better way to do it.  Currently, Login.java 
takes care of pushing the NDC so that subsequent requests in the log 
will show the user's id.  I am then using my Border component to clear 
the NDC.  It does seem to work, but I think there is a better approach 
to take.

I attempted to setup my own Tapestry Engine to do this, but it would 
blow up on any request with a call to createEngine causing an 
InstantiationException with a ServletException.

Is an Engine the way to go?  Any help on how to setup a custom engine? 
Would I be better off to create a servlet filter and move it outside of 
Tapestry?

Thanks!
Joseph

---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org