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 Jenica Mehta <je...@rediffmail.com> on 2008/01/30 07:00:45 UTC
getAllAppenders() function throws exception
Hi,Here is snippet of my code. This code throws exception while leaving the main function, something related to getAllAppenders() which it is unable to delete.
#include <log4cxx/logger.h>
#include <log4cxx/fileappender.h>
using namespace log4cxx;
using namespace log4cxx::spi;
using namespace log4cxx::helpers;
int _tmain(int argc, _TCHAR* argv[]){
LoggerPtr logger = Logger::getLogger(_T("test"));
AppenderPtr a1 = new FileAppender();
a1->setName(_T("testAppender1"));
logger->addAppender(a1);
AppenderList list = logger->getAllAppenders();
AppenderPtr aHat = list.front();
}This works fine if in project settings -> C/C++ -> Code Generation -> Runtime Library is set to Multi-threaded Debug DLL in Visual Studio. but if different runtime library is set, getAllAppenders() function throws exception of not able to delete the appenderlist. Any help on this will be appreciated. I am new member to this mailing list. Please ignore if I have put the mail wrongly.Thanks & Regards,Jenica
Re: getAllAppenders() function throws exception
Posted by Curt Arnold <ca...@apache.org>.
Actually, I'm surprised you were able to build. You may be getting
bit by the issue reported in LOGCXX-219 (https://issues.apache.org/jira/browse/LOGCXX-219
). There is the potential for disaster when log4cxx and the client
code both instantiate the same template, but have different settings.
But, It is still never a healthy thing to mix and match C run time
libraries within an application. Rev 616702 should build. If you
find yourself getting a copy prior to that, try again using https
instead of http.