You are correct regarding the Thread usage. Most containers pool this
resource and subsequent request may be handled by the same Thread, or a
different one, at the whim of the container.  However, no Thread will be
used simultaneously by more than one requestor.

You can get the user Principle information from the EJB context via
EJBContext.getCallerPrincipal() to access the username/role information...
Upon which it can simply be injected into the log stream via NDC/MDC calls.

Hope it helps,

-d

-----Original Message-----
From: Aaron Rustad [mailto:[EMAIL PROTECTED] 
Sent: Monday, February 28, 2005 11:22 AM
To: log4j-user@logging.apache.org
Subject: How can I log steps between session bean?

I have a requirement to log interesting steps of a process that may call
many different SessionBeans. This process may also be called by other users
so not only do I have to uniquely identify the process, but I also have to
identify the user that started the process. The problem with session beans,
from what I understand, is that there is no guarantee that one thread will
be used between method invocations on separate beans. Has anyone else tacked
this problem? 

 

Thanks for your help!

Aaron.



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

Reply via email to