Hi Mike
Could you be a little more elaborate aboute the solution please. I think
I have the exact problem you describe here but I do not understand how to
solve it. Im using log4cxx-0.9.7 under linux with g++ 3.2.3. I've built two
modules as shared libraries who I want to use from my main program. But I
get the same error as described below so..
Are the reordering of linking supposed to be done when I build log4cxx and
if so how do I do that (I'm not a autoconf and make master)?
Thanks
/Ulf
-----Original Message-----
From: Bristol, Michael <[EMAIL PROTECTED]>
Subject: Error: You have tried to set a null level to root
Date: Wed, 1 Sep 2004 16:57:38 -0400
Content-Type: text/plain;
charset="iso-8859-1"
Regarding the "null level to root" issue - I found it to be a symptom of the
order of initialization of objects in the library. I believe it has been
discussed before - the log4cxx-user mailing list archives have some mention
of it under the context of static library problems.
I poked around in a debugger when I was getting it and found that sometimes
the static members on the Level class that define the logging levels (i.e.
Level::OFF, Level::DEBUG, etc) can be requested by the application before
the module that they reside in has been initialized. So instead of a
pointer to a new Level Object, asking for Level:OFF just gives you null and
that causes the error.
If I re-ordered the link line so that level.o and logmamager.o came first
and it went away. Additionally if you've got something calling log4cxx
during pre-main initialization in a shared library environment, make sure
the log4cxx library comes first in the link line.
I have not found a good answer to the "single configuration file" question
yet myself. Maybe it's intended to be left up to the user of log4cxx to
configure.
Later,
Mike
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.806 / Virus Database: 548 - Release Date: 2004-12-05