|
Hello All, I would like to add my custom appender into log4cxx library. I have the following MACRO in my custom appender header file.
namespace log4cxx namespace namespaceMSMQ { class MSMQAPPENDER; typedef helpers::ObjectPtrT<MSMQAPPENDER> MSMQAPPENDERPtr;
class MSMQAPPENDER : public AppenderSkeleton { public: DECLARE_ABSTRACT_LOG4CXX_OBJECT(MSMQAPPENDER) BEGIN_LOG4CXX_CAST_MAP() LOG4CXX_CAST_ENTRY(MSMQAPPENDER) LOG4CXX_CAST_ENTRY_CHAIN(AppenderSkeleton) END_LOG4CXX_CAST_MAP()
MSMQAPPENDER(); MSMQAPPENDER(const LayoutPtr& layout); ~MSMQAPPENDER(); } } }
My xml Configuration file looks like below. <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
<log4j:configuration debug="true" xmlns:log4j="http://jakarta.apache.org/log4j/"> <appender name="Test" class="org.apache.log4cxx.namespaceMSMQ.MSMQAPPENDER"> <layout class="org.apache.log4j.SimpleLayout"/> </appender> <root> <priority value ="debug" /> <appender-ref ref="Test" /> </root> </log4j:configuration>
When I tried to configure the xml configuration file using “DOMConfigurator::configureAndWatch(_T("../library/msmqlogging.xml"))” it couldn’t create the appender? Looks like it couldn’t find the appender name. Any help is greatly appreciated.
Thanks, PK
|
- Re: Custom Appender Question. Kadarkarai, Prabhakar \(Prabhakar\)
- Re: Custom Appender Question. Curt Arnold
