DataPower Gateway only

activity-log

Use the Activity Log policy 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.

The activity-log policy has the following format:
- activity-log:
  title: title
  description: description
  content: activity_to_log_if_call_successful
  error-content: activity_to_log_if_call_unsuccessful

Apply this policy by adding an assembly extension with an execute field to your OpenAPI (Swagger 2.0) definition file.

You can also apply an activity-log policy by using the API Designer assembly editor to add a built-in policy to the API. For more information, see Activity Log (activity-log) in the built-in policies section.

For more information on activity-log output with examples, see ../com.ibm.apic.apionprem.doc/rapim_analytics_apieventrecordfields.html

The following table describes the policy properties:
Table 1. Activity Log policy properties
Property label Required Description Data type
Title Yes A title for the policy is required, but a default value, activity-log is provided. string
Description No A description of the policy. string
Content Yes 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 if 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

Example 1

# use defaults

- activity-log:
  title: default activity logging

Example 2

- activity-log:
  title: no logging for successful calls
  content: none
  error-content: activity