Configuring activity logging

You can configure your logging preferences for the API activity that is stored in analytics, overriding the default activity logging behavior.

About this task

Note:
  • This task relates to configuring an OpenAPI 3.0 API definition. For details on how to configure an OpenAPI 2.0 API definition, see Editing an OpenAPI 2.0 API definition.
  • OpenAPI 3.0 APIs are supported only with the DataPower® API Gateway, not with the DataPower Gateway (v5 compatible).
  • For details of current OpenAPI 3.0 support limitations, see OpenAPI 3.0 support in IBM® API Connect.

You can complete this task either by using the API Designer UI application, or by using the browser-based API Manager UI.

An API event record exists for each API execution event in the Gateway server. By default, the content type for a successful API execution is activity, and payload for an API call the results in an error code. When you compose your API definition, you can change the type of content to log in these API event records. During API execution, the activity data is stored in the log context variable, which populates the API event record on completion of the API execution; for more information, see API activity logging context variables.

Note:

Activity logging that calls for logging of analytics data upon success doesn't apply for the OAuth provider. The OAuth provider logs analytics data for failure cases, but doesn't log successful cases.

At any time, you can switch directly to the underlying OpenAPI YAML source by clicking the Source icon OpenAPI Source icon. To return to the design form, click the Form icon Form icon.

Procedure

  1. Open the API for editing, as described in Editing an OpenAPI 3.0 API definition.
  2. Select the Gateway tab, expand Gateway and portal settings, then click Activity Log.
  3. Select Enabled, then select options for the Success Content and Error Content fields as follows:

    Field label Description
    Success Content Defines the type of content to be logged when the operation is successful.
    • none: API events are not logged.
    • activity: Logs the API resource URI.
    • header: Logs the API resource URI and HTTP headers.
    • payload: Logs API resource URI, HTTP headers, and payload; all information, including the payload that is received in a request or returned in a response, is recorded.

    The default value is activity.

    Error Content Indicates what content to log when an error occurs.
    • none: API events are not logged.
    • activity: Logs the API resource URI.
    • header: Logs the API resource URI and HTTP headers.
    • payload: Logs API resource URI, HTTP headers, and payload; all information, including the payload that is received in a request or returned in a response, is recorded.

    The default value is payload.

  4. Click Save to save your changes.