logging-log4cxx-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kadarkarai, Prabhakar \(Prabhakar\)" <prabhak...@avaya.com>
Subject Can i have multiple custom appenders loaded in my application? How?
Date Wed, 16 Feb 2005 05:44:06 GMT
Hello All,

I have a custom appender (DLL) which can be used to create and send
message to MSMQ. 

I want to use the same appender with different configuration file that
means multiple appender scenarios. 

When I tried with multiple appender in configuration file like below it
doesn't work. It loads both appender but creates and sends message to
only one MSMQ

  <appender name="MSMQ" class="MSMQAppenderDLL.MSMQAppenderDLL">

    <param name="Path" value="drprabhakar-a0\\private$\\MSMQ" />


  </appender>

 

  <appender name="MSMQLive" class="MSMQAppenderDLL.MSMQAppenderDLL">

    <param name="Path" value="drprabhakar-a0\\private$\\MSMQLive" />


  </appender>

 

  <root>

    <priority value ="debug" />

    <appender-ref ref="MSMQ" />

    <appender-ref ref="MSMQLive" />

 

 

When I tried with two different DLL to achieve the results it doesn't
work either. Sample code is below.

 

            HMODULE hModule = LoadLibrary ( "MSMQAppenderDLL.dll" );

            if (hModule==NULL)     return;

            DOMConfigurator::configure(_T("MSMQConfigurationDll.xml"));

            String loggerName = _T("MSMQConfigurationDll");

            LoggerPtr logger = Logger::getLogger(loggerName);

            logger->debug(_T("Custom Client debug message"));

 

            HMODULE shModule = LoadLibrary ( "LIVEMSMQAppenderDLL.dll"
);

            if (shModule==NULL)   return;

 
DOMConfigurator::configure(_T("LIVEMSMQConfigurationDll.xml"));

            String LiveloggerName = _T("LIVEMSMQConfigurationDll");

            LoggerPtr Livelogger = Logger::getLogger(LiveloggerName);

            Livelogger->debug(_T("Live Custom Client debug message"));

 

It crashes when it calls the DOMConfigurator.confiqure at the second
time. First one it works. If I have them in a separate application it
works flawlessly.

 

Would you please help me out to solve this.

 

PK


Mime
View raw message