2 Replies Latest reply on May 4, 2010 6:52 AM by maeckie

    Not able to make jboss-log4j send SNMP traps

      Hi,

       

      I have been trying to make log4j send SNMP traps using the the "org.apache.log4j.ext.SNMPTrapAppender".

      I have used the example appender delivered in jboss-log4j.xml which looks like this:

       

      <!-- Log events through SNMP -->
         <appender name="TRAP_LOG">
           <errorHandler/>
           <param name="ImplementationClassName" value="org.apache.log4j.ext.JoeSNMPTrapSender"/>
           <param name="ManagementHost" value="10.x.x.x"/>
           <param name="ManagementHostTrapListenPort" value="162"/>
           <param name="EnterpriseOID" value="1.3.6.1.4.1.24.0"/>
           <param name="LocalIPAddress" value="10.47.48.75"/>
           <param name="LocalTrapSendPort" value="161"/>
           <param name="GenericTrapType" value="6"/>
           <param name="SpecificTrapType" value="12345678"/>
           <param name="CommunityString" value="public"/>
           <param name="ForwardStackTraceWithTrap" value="true"/>
           <param name="Threshold" value="ERROR"/>
           <param name="ApplicationTrapOID" value="1.3.6.1.4.1.24.12.10.22.64"/>
           <layout>
                  <param name="ConversionPattern" value="%d,%p,[%t],[%c],%m%n"/>
           </layout>
         </appender>

       

      In order to capture everything which is passed through log4j I tried to add the appender-ref in the root-category like this:

          <root>
            <priority value="TRACE" />

            <appender-ref ref="TRAP_LOG"/>

            <appender-ref ref="CONSOLE"/>
            <appender-ref ref="FILE"/>
         </root>

       

      I've also tried to direct some of the loggers (which works when logging to file) to this appender but I am still not getting anything on my snmp host.

      I tried to tcpdump on the application server, but there seems to be no outgoing traffic to the SNMP host, so it doesn't look like log4j is either missconfigured and nothing ends up in the TRAP_LOG-appender or I have to do something else in order for it to start sending SNMP traps.

       

      Can someone please shed som light on this?

       

      Cheers,

      Marcus