Monitor Levels

Monitor levels can be set in systemConfig.xml. The following values may be set:

  • Default level
  • Provider levels
  • Contribution levels
  • Composite levels

Setting the Default Monitor Level

To set the default monitor level, set the value of the monitor.level attribute of the runtime element in systemConfig.xml:

<config ...>
   <runtime monitor.level="DEBUG" .../>
</config>

Valid values are: SEVERE, WARNING, INFO, DEBUG, and TRACE.

Setting Provider Levels

In order to centralize all logging in a runtime, log events emitted by third-party libraries in extensions are routed to the Fabric3 monitor framework. This is done by replacing implementations of common logging APIs (e.g. Apache Commons Logging and SLF4J) with a Fabric3 variant that bridges to the monitor framework. It is possible to set logging levels for third-party libraries by configuring a provider level in systemConfig.xml:

<config...>
   <monitor ...>
      <provider.levels>
         <level name="..." value=""/>
         <level name="..." value=""/>
      </provider.levels> 
   </monitor>
</config> 

 The provider name corresponds to the Java package name of the provider classes you want to enable, for example, "org.hibernate". The value attribute corresponds to the monitor level.

Setting Contribution Levels

It is also possible to enable a monitoring level for a particular contribution, for example, if you need to debug a particular set of services. This is done in systemConfig.xml:

<config...>
   <monitor ...>
      <contribution.levels>
         <level name="..." value=""/>
         <level name="..." value=""/>
     </contribution.levels> 
   </monitor>
</config> 

 The name attribute corresponds to the contribution URI. For example, a the URI for contribution foo.jar will be "foo".

Dynamically Changing Monitoring Levels

Fabric3 provides the ability to dynamically adjust monitoring levels using the MonitorService service via the Management Resource Framework (MRF) or JMX. The MRF address is http://<server address>:port/management/runtime/monitor. Values may be read using HTTP GET and changed using HTTP POST. Valid levels are:

  • SEVERE - Errors encountered by the runtime or an application
  • WARN - Denote an event that may potentially lead to an error or incorrect operation.
  • INFO - Informational messages
  • DEBUG - Used for debugging events

Monitoring levels can be adjusted for a contribution, component or deployable composite. Since components are hierarchical, setting a parent component will recursively propagate to child components. For example, given a component hierarchy of domain://foo/bar/baz, setting the monitor level for domain://foo/bar will also set the monitor level for domain://foo/bar/baz. To set the monitor level of all application components, use the following URI: <domain name>://. Similarly, to sett the monitor level for all runtime components, use the URI: fabric3://.

Â