You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4cxx-user@logging.apache.org by Bob Young <by...@jumptrading.com> on 2005/01/04 21:41:23 UTC

Problem on Windows


I am getting an error on termination of a program using log4cxx 0.9.7 
under Windows VC6.0.  It appears that the destructor for the logger 
object is causing a memory error.  Here is the code:

----------------------------------------------
#include "log4cxx/logger.h"
#include "log4cxx/basicconfigurator.h"
#include "log4cxx/helpers/exception.h"

using namespace log4cxx;
using namespace log4cxx::helpers;

LoggerPtr logger(Logger::getLogger("MyApp"));

int main()
{
     int result = EXIT_SUCCESS;
   
    try {
        BasicConfigurator::configure();
        LOG4CXX_INFO(logger, "Starting test.");
    }
    catch (Exception&)
    {
        result = EXIT_FAILURE;
    }

    return 0;
}
-------------------------------------------------------------------

I see the message from the logger on the console OK, but then get a 
dialog box with the following text:

The instruction at "0x55901a9d" referenced memory at "0x003f3e50".  The 
memory could not be "read".
Click on OK to terminate the program

Any ideas?
Thanks,
Bob