DataPower API Gateway
only

activity-log

If you’re using the DataPower® API Gateway, you can use the activity-log extension to configure your logging preferences for the API activity that is stored in analytics. The preferences that you specify will override the default settings for collecting and storing details of the API activity.

An API event record exists for each API execution event in the Gateway server. By default, the content type that is collected and stored in API event records is activity for when API execution completes successfully, and payload for when API execution completes with an error code. When you compose your API definition, you can change the type of content to log in these API event records. For more information about API event records, see API event record field reference.

Note that if you're using the DataPower Gateway (v5 compatible), you can configure your logging preferences by using an activity-log policy in your API assembly. For more information, see activity-log.

The activity-log extension takes the following form:
activity-log:
  success-content: activity_to_log_if_call_successful
  error-content: activity_to_log_if_call_unsuccessful
  enabled: is_activity_logging_enabled
Note: If payload logging is enabled, for the gateway to capture payloads buffering must also be enabled.
activity-log:
  success-content: activity_to_log_if_call_successful
  error-content: activity_to_log_if_call_unsuccessful
  enabled: is_activity_logging_enabled
buffering: true

The following table shows the properties of the activity-log extension:

Table 1. The properties of the activity-log extension
Property Required Description Type
success-content No Defines the type of content to be logged when the operation is successful.
Valid values:
  • none: Indicates that no logging occurs.
    Restriction: This option disables notifications for application developers who use your Developer Portal.
  • activity: Logs invocation only (only the resource URI is recorded).
  • header: Logs activity and header.
  • payload: Logs activity, header, and payload (the original request, if any, and the final response).

The default value is activity.

String
error-content No Indicates what content to log when an error occurs.
Valid values:
  • none: Indicates that no logging occurs.
    Restriction: This option disables notifications for application developers who use your Developer Portal.
  • activity: Logs invocation only (only the resource URI is recorded).
  • header: Logs activity and header.
  • payload: Logs activity, header, and payload (the original request, if any, and the final response).

The default value is payload.

String
enabled No Indicates whether activity logging is enabled or disabled. Boolean

Example 1

Override the default activity logging settings:
activity-log:
    success-content: none
    error-content: header
    enabled: true

Example 2

Turn off activity logging:
activity-log:
    enabled: false