3 Replies Latest reply on Dec 4, 2007 12:02 AM by Jay Howell

    Log4j and JMS Appender Using ActiveMQ

    Jeff Puro Newbie

      Does anyone have an example of setting up a log4j appender that points to an ActiveMQ topic? I am trying to find information on this but have not been able to locate anything as of yet.

      Regards,

      Jeff

        • 1. Re: Log4j and JMS Appender Using ActiveMQ
          Jay Howell Apprentice

          I have not done it, but I can imagine that it's pretty easy. You just set up ActiveMQ like it says in the following instructions. http://wiki.jboss.org/wiki/Wiki.jsp?page=ActiveMqIntegration

          Then set up a topic you want to use as logging as an AdminObject(the example above set's up Queue's A-D, you can set a topic up the same way.
          ex..

          activemq/topic/Logging <depends optional-attribute-name="RARName">jboss.jca:service=RARDeployment,name='activemq-ra-4.0.1.rar' javax.jms.Topic PhysicalName=topic.Logging

          When configuring the jms appender for log4j, you would use the following arguments...






          http://forum.java.sun.com/thread.jspa?threadID=666018&tstart=0
          Hope this gives you something to go on...
          Cheers, Jay:)

          • 2. Re: Log4j and JMS Appender Using ActiveMQ
            Jay Howell Apprentice

            I have not done it, but I can imagine that it's pretty easy. You just set up ActiveMQ like it says in the following instructions. http://wiki.jboss.org/wiki/Wiki.jsp?page=ActiveMqIntegration

            Then set up a topic you want to use as logging as an AdminObject(the example above set's up Queue's A-D, you can set a topic up the same way.
            ex..

            activemq/topic/Logging <depends optional-attribute-name="RARName">jboss.jca:service=RARDeployment,name='activemq-ra-4.0.1.rar' javax.jms.Topic PhysicalName=topic.Logging

            When configuring the jms appender for log4j, you would use the following arguments...






            http://forum.java.sun.com/thread.jspa?threadID=666018&tstart=0
            Hope this gives you something to go on...
            Cheers, Jay:)

            • 3. Re: Log4j and JMS Appender Using ActiveMQ
              Jay Howell Apprentice

              Sorry one more time...
              I have not done it, but I can imagine that it's pretty easy. You just set up ActiveMQ like it says in the following instructions. http://wiki.jboss.org/wiki/Wiki.jsp?page=ActiveMqIntegration

              Then set up a topic you want to use as logging as an AdminObject(the example above set's up Queue's A-D, you can set a topic up the same way.
              ex..

              <mbean code="org.jboss.resource.deployment.AdminObject" name="activemq.topic:name=Logging">
              <attribute name="JNDIName">activemq/topic/Logging</attribute>
              <depends optional-attribute-name="RARName">jboss.jca:service=RARDeployment,name='activemq-ra-4.0.1.rar'</depends>
              <attribute name="Type">javax.jms.Topic</attribute>
              <attribute name="Properties"> PhysicalName=topic.Logging</attribute>
              </mbean>


              When configuring the jms appender for log4j, you would use the following arguments...

              <appender name="JMS" class="org.apache.log4j.net.JMSAppender">
               <param name="TopicConnectionFactoryBindingName"
              value="activemq/TopicConnectionFactory"/>
               <param name="TopicBindingName" value="activemq/topic/Logging" />
               </appender>


              http://forum.java.sun.com/thread.jspa?threadID=666018&tstart=0
              Hope this gives you something to go on...
              Cheers, Jay:)