Please take our Survey
logo       

Choosing A Webhost:
A web hosting service is a type of Internet hosting service that allows individuals and organizations to provide their own website accessible via the World Wide Web. Web hosts are companies that provide space on a server they own for use by their clients as well as providing Internet connectivity, typically in a data center. Web hosts can also provide data center space and connectivity to the Internet for servers they do not own to be located in their data center, called colocation. more...

Re: Can't create appender under Redhat Enterprise Server (k 2.4): msg#00038

apache.logging.log4cxx.user

Subject: Re: Can't create appender under Redhat Enterprise Server (k 2.4)

Curt,
Here's the application code I'm testing with.
Thanks for you help.

// Log4CxxTest.cpp : Defines the entry point for the console application.
//

#include <log4cxx/logger.h>
#include <log4cxx/xml/domconfigurator.h>
#include <log4cxx/helpers/exception.h>
#include <log4cxx/ndc.h>
#include <log4cxx/helpers/loglog.h>

using namespace log4cxx;
using namespace log4cxx::helpers;
using namespace log4cxx::xml;

#include <string>


int main(int argc, char* argv[])
{
std::string sXMLFile;

sXMLFile = _T("logging.xml");
int result = EXIT_SUCCESS;

try
{
LogLog::setInternalDebugging( true );
DOMConfigurator::configure(sXMLFile.c_str());
//BasicConfigurator::configure();
LoggerPtr rootLogger = Logger::getLogger(_T("ALogger"));

NDC::push(_T("trivial context"));
LOG4CXX_DEBUG(rootLogger,_T("debug message"));
LOG4CXX_INFO(rootLogger,_T("info message"));
LOG4CXX_WARN(rootLogger,_T("warn message"));
LOG4CXX_ERROR(rootLogger,_T("error message"));
LOG4CXX_FATAL(rootLogger,_T("fatal error"));

}
catch(Exception * e)
{
result = EXIT_FAILURE;
}

return result;
}


>
> On Dec 9, 2004, at 4:16 PM, brianw1138@xxxxxxxxxxx wrote:
>
> > I am developing a cross platform system using Log4Cxx, CppUnit, Boost
> > and STLPort. Under Linux I'm using Gcc 3.3.4 and under Windows VC7.1.
> > Under Windows it all works pretty well, after some sleepless nights,
> > but under Linux, Log4Cxx can't find any of the Appenders. I've trimmed
> > the program down to just Log4Cxx, and still no go. I trimmed the
> > Config file down to the root logger, my logger, and two appenders, a
> > FileAppender and the ConsoleAppender using the DOMConfigurator.
> >
> > I turned on Internal debugging and added some LogLogs to try and
> > figure out what is going on (see below, I trimmed out my mesages), and
> > what I see is the there are no appenders in the registry map, but they
> > get added after I ask for them. Even so, I can't create appenders (I
> > hoped that after getting them into the registry, things would work
> > out, but no dice.)
> >
>
> Are you doing your configuration in the constructor of a non-local
> static variable? Since there is no guarantee on the order that these
> initializers occur, there is the possibility that the configuration is
> being interpreted before the available appenders have added themselves
> to the map used to resolve the configuration file. In that case, you
> need to find some way to defer configuration until all the non-local
> static variables have been initialized.
>



<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
qplus.devel/200...    network.jabber....    debian.qa-packa...    encryption.gpg....    python.dabo.dev...    uclinux.devel/2...    science.mathema...    recreation.pesc...    kernel.ck/2004-...    mozilla.devel.e...    tex.latex.prosp...    ietf.multi6/200...    bbc.cvs/2002-11...    xfree86.newbie/...    jakarta.taglibs...    altlinux.hardwa...    comedi/2002-05/...    horde.bugs/2004...    games.diplomacy...    finance.e-gold....    web.dom.test-su...    lang.ruby.rails...    os.netbsd.devel...    video.gstreamer...   
Home | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive 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

Navigation