aspose file tools*
The moose likes Other Open Source Projects and the fly likes log4j : NDC Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Products » Other Open Source Projects
Bookmark "log4j : NDC" Watch "log4j : NDC" New topic

log4j : NDC

Mehul Mistry
Ranch Hand

Joined: Feb 10, 2006
Posts: 43
I working with one of the application developed in java and using log4j for logging. It has also been configured for chainsaw tool of Apache. When examining logs for through chainsaw, I noticed that there is a column called as NDC (nested diagnostic contexts). This is printing some text while at some events (Which I am not able to figure out, what kind of event). Also I noticed that when some text is printed in NDC the category for log is "Transactions".
I want to know under what condition this log will be printed and how and from where log4j picks up the string for NDC and prints it on the logs.

Can someone please help put some light on this.

[ August 08, 2008: Message edited by: Mehul Mistry ]
Paul Clapham

Joined: Oct 14, 2005
Posts: 18121

It's right there in the log4j manual. Scan for "NDC".
Mehul Mistry
Ranch Hand

Joined: Feb 10, 2006
Posts: 43
I never used NDC before so was not aware of it.In my initial investigations I could not reach there.Anyway, saw the manual, and traced the location where some text is pushed in NDC. Thank you.

I agree. Here's the link:
subject: log4j : NDC
Similar Threads
Log program name in Log4j?
JVM Log File Aggregator
Cannot find NullPointerException
Log4j Viewer