logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mark Masterson" <mark_master...@compuserve.com>
Subject RE: NDC usage ?? -> some help please ? >> Hellu
Date Mon, 11 Jun 2001 19:11:21 GMT
Eddie,

Nobody's probably jumping to answer your more general question because the
NDC mechanism is very flexible - it is impossible to say "this is THE right
way to use it", simply because there are so many different ways that you
could use it, for many different purposes.  Having said that, the answer to
your newer question is more straightforward (which is why you're getting
more than one answer!).  NDC follows the thread of execution: in your
example, because you call your second class from the servlet, the thread of
execution moves from your servlet to your other class, and the NDC stack is
built to reflect this.  In this way, it's just like the standard Java
execution stack.  Different servlets, OTOH == different threads == different
NDC stacks.  Do you understand?

Thus, the answer to (part) of your original question is: no, the NDC is not
bound to any specific Category instance.  It's bound to the thread of
execution that pushes the first item onto its stack.  Once you understand
this, the answers to the rest of your questions (which are *very* dependent
on the details of your own code) are usually fairly self-evident.

Cheers,
Mark


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


Mime
View raw message