On Tue, Feb 26, 2002 at 04:16:25AM -0800, marc fleury wrote:
> 
> |>PS: is there a threadTrace() thingy where it creates a new file per thread
> |>that would come it and the messages are linked to a given thread going
> |>through? is that a custom logger?
> |>
> |You lost me here.  What are you trying to track?
> 
> A thread.
> 
> A thread is coming in and collecting thread information as it goes.
> 
> If 2 threads go through the log4j logger and "trace" do the message get
> "mixed"??? in that case it is VERY hard to debug a running system as you
> don't know what thread is talking.  Think of that logger as a PROBE for a
> given thread going through.  It goes through on only the messages originated
> by that thread get logged in a file.


Check out the NDC(Nested Diagnostic Context) in log4j for this 

<quote>

The NDC class implements nested diagnostic contexts as defined by Neil Harrison in the 
article "Patterns for Logging Diagnostic Messages" part of the book "Pattern Languages 
of Program Design 3" edited by Martin et al.

A Nested Diagnostic Context, or NDC in short, is an instrument to distinguish 
interleaved log output from different sources. Log output is typically interleaved 
when a server handles multiple clients near-simultaneously.

Interleaved log output can still be meaningful if each log entry from different 
contexts had a distinctive stamp. This is where NDCs come into play.

Note that NDCs are managed on a per thread basis. NDC operations such as push, pop(), 
clear(), getDepth() and setMaxDepth(int) affect the NDC of the current thread only. 
NDCs of other threads remain unaffected.

</quote>

from http://jakarta.apache.org/log4j/docs/api/org/apache/log4j/NDC.html



> 
> Ex: you are running a system, something is wrong, if you look at the logs
> you see 254 threads going through and the messages make no sense.  You turn
> on the "logTrace()" and ONE thread that is going through gets redirected to
> a file (or a finite number whatever).  Each file is just the talk from ONE
> thread.  Useful for debugging the running system.
> 
> Yes?
> 
> marcf
> |
> |--jason
> |
> |
> |
> |_______________________________________________
> |Jboss-development mailing list
> |[EMAIL PROTECTED]
> |https://lists.sourceforge.net/lists/listinfo/jboss-development
> 
> 
> _______________________________________________
> Jboss-development mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/jboss-development
> 
> 

-- 
regards


Neale Swinnerton

_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to