On Feb 8, 2005, at 4:05 PM, Dan Dimerman wrote:

I have a similar problem with static libraries. I have a bunch of static libs, which all use log4cxx and declare their own logger hierarchy (descendant from the main app's logger).
Whenever I log from the main app code, it's all good but when I go deep into the static lib code, I get an exception.
Tracing it, I saw that the problem is in Logger::getEffectiveLevel().
Looks like it tries to deduce the debugging level when it's not defined for this specific logger. So it goes up to its parent, up till it gets to a logger named "root" which has a null parent pointer.
Problem is, this root logger is different from the main app root logger: different addresses, different data in the fields, namely the debugging level.
For the classes in the static libs, their loggers are declared as static. Could this be the problem?


There are no DLLs involved in this situation.


Could you clarify a few things:

What version of log4cxx are you using, log4cxx-0.9.7 or the CVS HEAD. There are a lot of things in 0.9.7 that have been fixed in the CVS version (but unfortunately things broken at the current CVS HEAD). If you can see if the problem still persists with the CVS HEAD that would be helpful.

Do you have just one executable but it was assembled from object files from multiple static libraries? Does that executable depend on log4cxx.dll or are you statically linking log4cxx into the executable?



Reply via email to