logging-log4cxx-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jenica Mehta" <jen_...@rediffmail.com>
Subject getAllAppenders() function throws exception
Date Wed, 30 Jan 2008 06:00:45 GMT
Hi,Here is&nbsp;snippet of my code. This code throws exception while leaving the main function,
something related to getAllAppenders() which it is unable to delete.
#include &lt;log4cxx/logger.h&gt;

#include &lt;log4cxx/fileappender.h&gt;


&nbsp;
using namespace log4cxx;

using namespace log4cxx::spi;

using namespace log4cxx::helpers;


&nbsp;
int _tmain(int argc, _TCHAR* argv[]){&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;



&nbsp;
LoggerPtr logger = Logger::getLogger(_T("test"));

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
AppenderPtr a1 = new FileAppender();

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
a1-&gt;setName(_T("testAppender1"));

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
logger-&gt;addAppender(a1);


&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
AppenderList list = logger-&gt;getAllAppenders();

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
AppenderPtr aHat = list.front();

}This works fine if in project settings -&gt; C/C++ -&gt; Code Generation -&gt;
Runtime Library is set to Multi-threaded Debug DLL in Visual Studio. but if different&nbsp;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 &amp; Regards,Jenica
Mime
View raw message