logging-log4cxx-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From g.w.john...@jpmorgan.com
Subject NDC Stack problem with threads
Date Fri, 04 Feb 2005 20:09:24 GMT
I am attempting to use the NDC functionality in log4cxx with threads.

As I understand the documentation, each thread has its own NDC stack. If I 
wish information from
the main thread to appear in the child threads' NDC, I need to call 
log4cxx::NDC::inheritStack()
with the return value from the parent's call to 
log4cxx::NDC::cloneStack().

Since the child thread does not have access to the parent's call to 
cloneStack(), I decided to
pass the returned Stack pointer to the constructor of my thread class. I 
planned to inherit at the
point when the thread is actually started.

However, the log4cxx::NDC::Stack type used with these methods is private 
to the NDC class.
There is a log4cxx::Stack type that looks like it was designed to solve 
this problem, but it is
not the same type.

There appears to be no way to do what I need.

Am I missing something?

G. Wade
This communication is for informational purposes only. It is not intended
as an offer or solicitation for the purchase or sale of any financial
instrument or as an official confirmation of any transaction. All market prices,
data and other information are not warranted as to completeness or accuracy and
are subject to change without notice. Any comments or statements made herein 
do not necessarily reflect those of JPMorgan Chase & Co., its subsidiaries 
and affiliates


Mime
View raw message