logging-log4cxx-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Lennart Goedhart" <lenn...@omnibase.com.au>
Subject Re: You have tried to set a null level to root.
Date Thu, 20 May 2004 07:41:09 GMT
I assume you get this when you pass the arg of the config file. What does your config file
look like?
When I comile that snippet of your code (with a few minor changes), it works fine.
I have he logfile I pass working with Conole, RollingFile and ODBC appenders...
  ----- Original Message ----- 
  From: Lars Schouw 
  To: Log4CXX User 
  Sent: Thursday, May 20, 2004 5:23 PM
  Subject: Re: You have tried to set a null level to root.


  Sorry forgot to tell that I also have a static variable declared in a header file
  static log4cxx::LoggerPtr logger;



  Lars Schouw <schouwla@yahoo.com> wrote:
    I tried to add a configuration file to my project but
    when I run it I get this error:
    You have tried to set a null level to root.
    and an exception it thrown.
    This is before I even hit the main function so it must
    belong to the static variable I declared the is
    initialized when the object is loaded.

    My souce code:

    // include log4cxx header files.
    #include 
    #include 
    #include 
    #include 

    using namespace log4cxx;
    using namespace log4cxx::helpers;

    // Define a static logger variable so that it
    references the logger instance named "RALtest".
    LoggerPtr logger = Logger::getLogger(_T("RALtest"));

    int main(int argc, char* argv[])
    {
    int result = EXIT_SUCCESS;
    try
    {
    if (argc > 1)
    {
    USES_CONVERSION;
    String propertyFileName = argv[1];
    PropertyConfigurator::configure(propertyFileName);
    }
    else
    {
    BasicConfigurator::configure();
    }

    logger->info(_T("Entering RALtest application."));
    ....

    Lars









    __________________________________
    Do you Yahoo!?
    Yahoo! Domains - Claim yours for only $14.70/year
    http://smallbusiness.promotions.yahoo.com/offer 


------------------------------------------------------------------------------
  Do you Yahoo!?
  Yahoo! Domains - Claim yours for only $14.70/year
Mime
View raw message