Activity log policy

Configure the activity log policy to manage the level of detail of the data stored in API events.

Note: In DataPower API Gateway and DataPower® Gateway (v5 compatible), use the activity log policy to control the level of detail that is recorded in API event data. If you use DataPower Nano Gateway or webMethods API Gateway, use log invocation policies instead of the activity log policy.
When you configure a project in the API Manager user interface, you use the activity log property to specify the data that is stored in API event records for calls to the API. The activity log property provides separate settings for successful API calls and failed API calls. The available activity log options are as follows:
  • none - API events are not logged.
  • activity - Logs the API resource URI. activity is the default log setting for successful API calls.
  • header - Logs the API resource URI and HTTP headers.
  • payload - Logs API resource URI, HTTP headers, and request and response payloads. payload is the default log setting for failed API calls, since the response payload might have useful information on the cause of the failure.
Note:

If your gateway is configured to authenticate all API calls with an OAuth provider, the data that is related to the OAuth call is only included in the API event data when the OAuth call fails. Successful OAuth authentication is not recorded in the API event data.

Important: The maximum API event record size is 19 Mb. The analytics subsystem rejects any API event records that are larger than 19 Mb.

Defining log setting in the API Manager UI

  1. In the API Manager UI, click API Studio, select the project that you want to work with. If you are not familiar with the API Studio, see Creating, deploying, and publishing APIs using IBM API Studio.
  2. Locate the policy sequence. Click the add icon icon next to it.
  3. From the list of gateways, select DataPower API Gateway or DataPower Gateway (v5 compatible).
  4. Enter the policy sequence name and click Add.
  5. From the Outline panel, select Additional settings.
  6. Click Activity Log and select Enabled.
  7. Then select the preferred log setting for Success Content and Error Content:
    • none - API events are not logged.
    • activity - Logs the API resource URI. activity is the default log setting for successful API calls.
    • header - Logs the API resource URI and HTTP headers.
    • payload - Logs API resource URI, HTTP headers, and request and response payloads. payload is the default log setting for failed API calls, since the response payload might have useful information on the cause of the failure.

Defining log setting in source for DataPower API Gateway and DataPower Gateway (v5 compatible)

Use the activity-log extension to configure your logging preferences.

activity-log:
  success-content: <success log setting: none, activity, header, payload>
  error-content: <failure log setting: none, activity, header, payload>
  enabled: <if activity logging is enabled: true or false>
Note: If payload logging is enabled, for the gateway to capture payloads buffering must also be enabled.
activity-log:
  success-content: <success log setting: none, activity, header, payload>
  error-content: <failure log setting: none, activity, header, payload>
  enabled: <if activity logging is enabled: true or false>
buffering: true
Example
No logging of successful calls, header logging for failed calls
activity-log:
    success-content: none
    error-content: header
    enabled: true
Disable activity logging
activity-log:
    enabled: false