|
|
Sponsor |
Re: I degrade some softwares on my computer, and now I can build log4 cxx o: msg#00025apache.logging.log4cxx.user
Hi, In my experience, the best way currently to avoid the problem you are having is do lazy initialisation when you use log4cxx statics to initialise your own statics/globals. For instance, when I needed to use a constant LevelPtr (e.g. Level::ERROR), I used instead the log4cxx Level enums (i.e. Level::ERROR_INT) and converted it to the LevelPtr static when actually using the level inside my class method. At that stage the Level statics are already initialised. This is also relevant to your lines: LoggerPtr logger = Logger::getLogger(_T("MyApp")); and LoggerPtr Bar::logger = Logger::getLogger(_T("MyApp")); For the second line, I suggest trying instead: LoggerPtr Bar::logger; (setting to zero if possible) and in the ctor initing it: logger = Logger::getLogger(_T("MyApp")); For the first line, you can do the same (without the ctor part), but add a global access GetLogger() method to first init the logger if not initialised yet, and then return it. (assuming LoggerPtr can be assigned a zero or some default value which can be checked) Hope this helps, Cheers, Barak PS - I am now going to try downgrading my automake and libtool to the versions working for you! Maybe at last autogen.sh will actually work for me. ________________________ Barak Simon GED IT Core Platform Deutsche Bank 190 George St. Sydney, 2000 Phone +61 2 925 85070 Fax +61 2 925 95050 wxiong@xxxxxxxxxx To: log4cxx-user@xxxxxxxxxxxxxxxxxx 20/10/2004 20:03 cc: Please respond to Subject: I degrade some softwares on my computer, and now I can build log4 cxx on Solaris 9 x86 log4cxx-user now. But... Hello, everybody, I degrade my automake from 1.9.2 to 1.6.3, and libtool from 1.5.10 to 1.4.3. This time, I successfully build log4cxx-0.9.7 on Solaris 9 x86. (Although I already build one by writing a makefile for it, ^_^.). But when I build and run a demo program with it, I got the following error message: david@billdavid>log4cxxtest test.properties You have tried to set a null level to root. Segmentation Fault(coredump) I have ever test the same program with the shared library built from my makefile. It runs very well. I find the above output message "You have tried to set a null level to root. " in RootCategory.cpp. But I don't know what it means. Can anybody give me some suggestion? The following is my program: #include <log4cxx/logger.h> #include <log4cxx/basicconfigurator.h> #include <log4cxx/helpers/exception.h> #include <log4cxx/propertyconfigurator.h> #include <log4cxx/xml/domconfigurator.h> #include <log4cxx/helpers/loglog.h> using namespace log4cxx; using namespace log4cxx::helpers; using namespace log4cxx::xml; LoggerPtr logger = Logger::getLogger(_T("MyApp")); class Bar { static log4cxx::LoggerPtr logger; public: void doIt(); }; LoggerPtr Bar::logger = Logger::getLogger(_T("MyApp")); void Bar::doIt() { logger->debug(_T("Did it again!")); } int main(int argc, char **argv) { int result = EXIT_SUCCESS; try { PropertyConfigurator::configure(argv[1]); logger->info(_T("Entering application.")); Bar bar; bar.doIt(); logger->info(_T("Exiting application.")); LOG4CXX_DEBUG(logger, _T("error message")); LOG4CXX_LOG(logger, Level::INFO, _T("fatal message")); } catch(Exception&) { result = EXIT_FAILURE; } return result; } Regards, Bill David 2004.10.19 -- This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden.
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | RE: I degrade some softwares on my computer, and now I can build log4cxx on Solaris 9 x86 now. But..., Xiong, Wei (Wei) |
|---|---|
| Next by Date: | Static initialization order (was Re: I degrade some softwares on my computer ...), Curt Arnold |
| Previous by Thread: | Re: I degrade some softwares on my computer, and now I can build log4 cxx on Solaris 9 x86 now. But..., Curt Arnold |
| Next by Thread: | RE: I degrade some softwares on my computer, and now I can build log4cxx on Solaris 9 x86 now. But..., Xiong, Wei (Wei) |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
Free MagazinesCisco NewsReceive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business. subscribe Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field. subscribe The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business. subscribe Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company. subscribe Total Telecom Total Telecom is "The Economist of the communications industry". subscribe |
Home | sitemap
| advertise | OSDir is
an inevitable website.
|