Configuring intentional logging

To use intentional logging, you must create and configure the following building blocks:
  • A business operation for which you want to log events
  • An instance of the IntentionalLoggerImpl class
  • A marker of type org.slf4j.Marker that you insert into the application logs

Logging business operations

You use intentional logging to log business events. Many of these events exist in a context of a business process or business operation. For example, as PolicyCenter handles an HTTP request, it is possible to log the following events:
  • The start of the request.
  • The finish of the request, which completes with some result or fails to complete with some error.
  • Intermediate events in the life cycle of the request, which can be errors, status changes, or debug events.

Interface IntentionalLogger

Methods on interface IntentionalLogger provide the means to log the start and stop of a business operation. You can also log status events or metrics for the business operation. Guidewire provides the following implementation class for the IntentionalLogger interface:
  • gw.api.intentionallogging.IntentionalLoggingImpl

Marker tags

Methods on IntentionalLogger use specific markers of type org.slf4j.Marker to specify the actual business events and operations to log. PolicyCenter provides a number of default markers in class PLLoggingMarker and PCLoggingMarker that you can use. You can also use the getMarker method on class MarkerFactory to generate a single use SLF4J marker.