Enable debug in SNMP connector 2
search cancel

Enable debug in SNMP connector 2

book

Article ID: 103768

calendar_today

Updated On:

Products

CA Service Operations Insight (SOI)

Issue/Introduction

How do we turn on the Snmp4j logging for trap data in SOI connector for SNMP 2.0 which is built on the IFW framework?

 

Environment

Release:
Component: SOIMGR

Resolution

1. Navigate to the SOI\resources folder on SNMP connector machine.

2. Open the log4j.xml file and add the following sections to the file (logger definitions section). 

<logger name="org.snmp4j">
  <level value="DEBUG" />
  <appender-ref ref="SNMP4J" />
   </logger>

<appender name="SNMP4J" class="org.apache.log4j.RollingFileAppender"> 
<param name="File" value="&logDir;/snmp4j.log"/> 
<param name="Append" value="true"/> 
<param name="MaxFileSize" value="20MB"/> 
<param name="MaxBackupIndex" value="10"/> 
<layout class="org.apache.log4j.PatternLayout"> 
<param name="ConversionPattern" value="%d{yyyy-MM-dd HH:mm:ss,SSS} %p [%t] %c{2} - %m. %n"/> 
</layout> 
</appender> 


3) Restart CA SAM Integration Services on this SNMP Connector.

4) Then you will see a snmp4j.log file created under SOI\log directory.

Additional Information

Note that there are steps in subsequent 4.2 patches that will create a log4j_IFW.xml as well as log4j.xml

In the circumstance where you find both log4j.xml and log4j_IFW.xml on the machine, the updates should be made in the log4j_IFW.xml file

 

It is possible to set extra debug of the logging by changing the debug flag to true in the XML file

<log4j:configuration debug="true" xmlns:log4j="http://jakarta.apache.org/log4j/">

This will write information about the configured log appenders in the jsw/logs/SAM-IntegrationServices_wrapper.log. Here it is possible to check if the SNMP appender is listed.

log4j: Retreiving an instance of org.apache.log4j.Logger.
log4j: Setting [org.snmp4j] additivity to [true].
log4j: Level value for org.snmp4j is  [DEBUG].
log4j: org.snmp4j level set to DEBUG
log4j: Class name: [org.apache.log4j.RollingFileAppender]
log4j: Setting property [file] to [C:/Program Files (x86)/CA/SOI/log/snmp4j.log].
log4j: Setting property [append] to [true].
log4j: Setting property [maxFileSize] to [20MB].
log4j: Setting property [maxBackupIndex] to [10].
log4j: Parsing layout of class: "org.apache.log4j.PatternLayout"
log4j: Setting property [conversionPattern] to [%d{yyyy-MM-dd HH:mm:ss,SSS} %p [%t] %c{2} - %m. %n].
log4j: setFile called: C:/Program Files (x86)/CA/SOI/log/snmp4j.log, true
log4j: setFile ended
log4j: Adding appender named [SNMP4J] to category [org.snmp4j].