logging-log4cxx-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Xiong, Wei (Wei)" <wxi...@lucent.com>
Subject I degrade some softwares on my computer, and now I can build log4 cxx on Solaris 9 x86 now. But...
Date Wed, 20 Oct 2004 10:03:05 GMT
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

Mime
View raw message