logo       

Sponsor
FREE Network Mapping Tool for Microsoft® Office Visio® Professional 2007
Don't map your network by hand - let LANsurveyor Exx press for Microsoft Visio Professional 2007 automatically create network diagrams for you!

Re: Can i have multiple custom appenders loaded in my application? How?: msg#00051

apache.logging.log4cxx.user

Subject: Re: Can i have multiple custom appenders loaded in my application? How?


On Feb 15, 2005, at 11:44 PM, Kadarkarai, Prabhakar (Prabhakar) wrote:

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


Hardly enough info to try to analyze the problem. So both appenders are being constructed but only one seems to be working? Can you set a breakpoint at activateOptions? Are the object's path's different at that time? Are there any static variables in your implementation (if path was static it would have the behavior that you are observing)? Is append being called on both appenders, or just one?


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"));



I'm assuming that your implementation class and registration is contained in both DLL's and you've assumed that the second load library would trigger a second registration of MSMQAppender which would override the entry registered by the first. I'm pretty sure that there are no guarantees on what occurs when you attempt to do that. Maintaining the first entry is safer since there may have been instances of the first implementation already created and it would expect to find the matching class information.




<Prev in Thread] Current Thread [Next in Thread>
Sponsor
FREE Network Mapping Tool for Microsoft® OfficeVisio Professional 2007
Don't map your network by hand - let LANsurveyor Express for Microsoft Visio Professional 2007
automatically create network diagrams for you!
Google Custom Search

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe

Navigation

Home | sitemap | advertise | OSDir is an inevitable website. super tiny logo