Using Loggingmonitorprocessor

The LoggingMonitorProcessor logs ERMA events and their attributes through log4j. It is configured via Spring inside the file containing ERMA beans (usually MonitorBeans.xml).

Configure the processor within its own process group to allow for limiting the types of events that are logged. Make sure to remove the processor first from the "defaultProcessGroup". The recommended approach is to log monitors whose names start with "alarm" and failed transaction monitors:

<!-- 
  Must set the logMonitorStarted attribute to false here or all monitors will be logged when started 
  regardless of the expression specified below 
  -->
<bean id="loggingMonitorProcessor" class="com.orbitz.monitoring.lib.processor.LoggingMonitorProcessor">
  <property name="logMonitorStarted" value="false"/>
</bean>
<bean id="loggingProcessGroup" class="com.orbitz.monitoring.lib.factory.ProcessGroup">
  <constructor-arg>
    <list>
      <ref bean="loggingMonitorProcessor"/>
    </list>
  </constructor-arg>
  <property name="expression" value="m.getAsBoolean('failed', false) or name.startsWith('alarm.')"/>
</bean>
<bean id="monitorProcessGroups" class="java.util.ArrayList">
  <constructor-arg>
    <list>
      <ref bean="defaultProcessGroup"/>
      <ref bean="loggingProcessGroup"/>
      <ref bean="lifecycleProcessGroup"/>
      <ref bean="gcStatsProcessGroup"/>
      <ref bean="threadStatsProcessGroup"/>
    </list>
  </constructor-arg>
</bean>

If necessary, output from this processor can be completely silenced by changing log4j configuration as follows:
<logger name="com.orbitz.monitoring.lib.processor.LoggingMonitorProcessor">
  <level value="WARN"/>
</logger>
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License