You could use a servlet filter that set's up the log4j ndc before the call's
to the tapestry application servlet.

The only trick would be to get the information out of the session. Inorder
to do that, you will need to poke around in the Engine and see how a visit
is stored.

Richard 

-----Original Message-----
From: Joseph Hannon [mailto:[EMAIL PROTECTED] 
Sent: Friday, September 09, 2005 8:42 AM
To: [email protected]
Subject: How would I send log4j dynamic info on each request?

Please excuse me if this is a duplicate of my earlier post. Not sure if
the 
first one was posted correctly.

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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to