Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Applications deployed on Fabric3 can take advantage of an its built-in injection-based monitoring and logging frameworkframework for logging and recording application events. The monitoring framework offers a number of benefits:

  • Strongly-typed monitoring interfaces and events
  • High performance logging (millions of events per second) with no garbage creation for latency-sensitive appications
  • Dynamic event level adjustment
Info

The samples contains an application in the features sectionwhich shows how to use the monitoring framework in an application and write a custom appender for recording events.

Using Monitoring

To use the monitoring framework in application code entails two things, creating a monitor interface and injecting the monitor in a component.

Define a

...

Monitor Interface.

The monitor interface is used for sending monitoring events. The interface defines operations for publishing events, monitoring levels and optional event message templates:

...

  • Severe - Critical errors that affect continue runtime operation
  • Warning - Error conditions that do not affect continued runtime operation or a potential runtime configuration issue
  • Info - Informational event
  • Debug - An event useful for diagnosing a problem
  • Trace - A low level event useful for diagnosing a problem

By default, info Info and above are enabled at runtime.

...

When an @Monitor annotation is encountered, the Fabric3 runtime will generate a monitor proxy and inject it based on the monitor interface. Depending on the current monitor level, events may be logged recorded or ignored. In the above example, if the monitor level is set to severe, the receivedRequest() event will be dropped.

...