Sorry for the delay in responding.  This is not really a function/issue of
NDC, which is localized to log4j only.  However, depending on what sort of
information you are trying to log, your goals are accomplishable by using
the EJB context to carry information from the presentation tier to the
business tier.

Things like the Security principle associated with the request are already
transmitted (i.e., username, etc).  With varying degrees of difficulty,
dependendent upon the actual container that you are using, it is possible to
inject your own extra material into constructs that are pushed across as
part of the context; thereby making them available on the service tier.  

For example, I have used this technique to push the webtiers sessionId
across so that in addition to the user/role credentials associated w/ the
request, it can be mapped to a specific servlet session id.

The way I have accomplished this in the past is to install a Servlet filter
which pushes an implementation of the standard Principle interface into the
request stream.  (NOTE: that this may not be as easy as it sounds, depending
on the container)

Hope it helps,

-d 

-----Original Message-----
From: Sushil Sureka [mailto:[EMAIL PROTECTED] 
Sent: Monday, February 14, 2005 5:15 PM
To: [email protected]
Subject: NDC and multiple Ears in J2EE environment

Hi,

We have run into a small issue and wondering if anyone had any advice on how
to solve this. We have multiple ear and each ear initializes its log service
using its own log.xml.

The issue is with the NDC and this set up. We have a filter set up to set
the NDC for each incoming request and the NDC messages shows up fine for the
web ear logs. But the problem is that when a remote call is made to beans
that are hosted in other ears, obviously the NDC is getting lost since they
are using two seperate instaces of Log4J. Is there any easy way of making
NDC somehow visible across two seperate instances of Log4J.

--
Thanks
Sushil

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to