How to set the IA logging to debug level

The attached file will work for both Windows and Unix systems.  It will sent the most commonly used functions to debug level.  You can modify the file as needed to suit your implementation.

 

  1. Identify where the xM IA service runs.  This usually runs on the same server as your management system with which you are integrating.
  2. Connect to the server such that you have access to the system's files/folders.  NOTE: Ensure you have appropriate credentials to make changes to files.
  3. Make a backup of your current <IAHOME>\etc\log4j.xml file.  <IAHOME> is typically in Program Files\AlarmPointSystems\IntegrationAgent on Windows systems OR /opt/AlarmPointSystems/IntegrationAgent on Unix.
  4. Replace the <IAHOME>\etc\log4j.xml file with the attached copy. NOTE: ensure you rename it to match (i.e. replace the existing file).
  5. The changes are picked up dynamically (i.e. no restart of xM services are necessary)
  6. One finished with your testing, you may copy the original back in place.

 

Alternatively, you can make a copy of the file for back up and edit the file in place. Replace the contents with the following:

 

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">

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

  <appender name="consoleAppender" class="org.apache.log4j.ConsoleAppender">
    <layout class="org.apache.log4j.PatternLayout">
      <param name="ConversionPattern" value="%d [%t] %p - %m%n"/>
    </layout>
  </appender>

  <appender name="txtAppender" class="com.alarmpoint.integrationagent.log.APRollingFileAppender">
    <param name="maxBackupIndex" value="10"/>
    <param name="MaxFileSize" value="10000KB"/>
    <param name="File" value="./log/AlarmPoint.txt"/>
    <layout class="org.apache.log4j.PatternLayout">
      <param name="ConversionPattern" value="%d [%t] %p - %m%n"/>
    </layout>
  </appender>

  <!-- Apache Commons tend to make a lot of noise which can clutter the log -->
  <logger name="org.apache">
    <level value="WARN"/>
  </logger>

  <!-- Spring Framework (see spring-config.xml) -->
  <logger name="org.springframework">
    <level value="WARN"/>
  </logger>

  <!-- Mule (see mule-config.xml) -->
  <logger name="org.mule">
    <level value="WARN"/>
  </logger>

  <!--
   | The following loggers must match those specified in spring-config.xml;
   | uncomment each to expose specific function logging
   +-->

  <!-- All Integration Agent functions -->
  <logger name="com.alarmpoint.integrationagent">
    <level value="WARN"/>
  </logger>

  <!-- Important system-wide events -->
  <logger name="com.alarmpoint.integrationagent.system">
    <level value="INFO"/>
  </logger>

  <!-- IA Manager -->
<!--
  <logger name="com.alarmpoint.integrationagent.manager">
    <level value="DEBUG"/>
  </logger>
-->

  <!-- Admin Gateway -->
<!--
  <logger name="com.alarmpoint.integrationagent.admin">
    <level value="DEBUG"/>
  </logger>
-->

  <!-- APClient Gateway -->
  <logger name="com.alarmpoint.integrationagent.apclient">
    <level value="INFO"/>
  </logger>

  <!-- QueueManager Gateway -->
<!--
  <logger name="com.alarmpoint.integrationagent.jms">
    <level value="DEBUG"/>
  </logger>
-->

  <!-- Health Monitor -->
<!--
  <logger name="com.alarmpoint.integrationagent.health">
    <level value="DEBUG"/>
  </logger>
-->

  <!-- Health Monitor mail daemon -->
<!--
  <logger name="com.alarmpoint.integrationagent.health.mail">
    <level value="DEBUG"/>
  </logger>
-->

  <!-- Heartbeats -->
  <logger name="com.alarmpoint.integrationagent.heartbeat">
    <level value="INFO"/>
  </logger>

  <!-- APXML Message Exchanger -->

  <logger name="com.alarmpoint.integrationagent.messaging">
    <level value="INFO"/>
  </logger>

  <!-- Integration Agent SOAP Support functions -->
  <logger name="com.alarmpoint.integrationagent.soap">
    <level value="DEBUG"/>
  </logger>

  <!-- Integration Agent HTTP Support functions -->
  <logger name="com.alarmpoint.integrationagent.http">
    <level value="DEBUG"/>
  </logger>

  <!-- All Integration Services -->
  <logger name="com.alarmpoint.integrationagent.services">
    <level value="DEBUG"/>
  </logger>

  <!-- An example of a specific Integration (i.e., all services in a domain) -->
<!--
  <logger name="com.alarmpoint.integrationagent.services.MyDomain">
    <level value="DEBUG"/>
  </logger>
-->

  <!-- An example of a specific Integration Service -->
<!--
  <logger name="com.alarmpoint.integrationagent.services.MyDomain.test_service_1">
    <level value="DEBUG"/>
  </logger>
-->

  <!-- The root category for all other loggers -->
  <root>
    <priority value ="WARN"/>
    <appender-ref ref="txtAppender"/>
    <appender-ref ref="consoleAppender"/>
  </root>

</log4j:configuration>

The items that changed were:

  1. The level for each logger is set to DEBUG from WARN
  2. The appender max backup files changed to 10 from 5
  3. The appender max file size was set to 10MB from 5MB

 

These are standard debug settings, however they may not perfectly fit every situation.  If there is more traffic then you may need larger file sizes or more backups to cover necessary time frame to capture enough data for troubleshooting.  Also, some loggers are commented out but may be necessary depending on the type issue that needs to be investigated.

 

Extensive Logging

For situations requiring extremely extensive information about the IA's interaction with the xMatters web service, you can turn on debug-level logging from the Apache libraries by following these steps:

 

1. Navigate to <IAhome>\conf\

2. Open the IA's log4j.xml file in a text editor.

3. Add the following lines to the appenders section:

  <appender name="apacheAppender" class="com.alarmpoint.integrationagent.log.APRollingFileAppender">
    <param name="maxBackupIndex" value="10"/>
    <param name="MaxFileSize" value="10000KB"/>
    <param name="File" value="./log/IA-apache-log.txt"/>
    <layout class="org.apache.log4j.PatternLayout">
      <param name="ConversionPattern" value="%d [%t] %p - %m%n"/>
    </layout>
  </appender>

4. Replace the existing apache.org section with these lines:

  <!-- Apache Commons tend to make a lot of noise which can clutter the log -->
  <logger name="org.apache">
    <level value="DEBUG"/>
    <appender-ref ref="apacheAppender"/>
  </logger>

5. Save the file.

 

These changes will cause the Apache messages to be logged to a specific file named IA-apache-log.txt; this makes it easier to concentrate on the messages that are of primary interest. Unfortunately, the Apache messages will also be logged to the main IA log file. To prevent excessive logging, after you have completed your test, set org.apache logging back to WARN and save the log4j.xml file.

 

Note: there is no need to restart the IA when making these changes. You should see the new information being logged to IA-apache-log.txt soon after making the changes.

 

xMatters Reference

JDN-3139 Originally created by gnavarre

Have more questions? Submit a request

0 Comments

Please sign in to leave a comment.
Powered by Zendesk