activity-log
Use the Activity Log policy to configure your logging preferences for the API activity that is stored in IBM® API Connect analytics. The preferences that you specify will override the default settings for collecting and storing details of the API activity.
Gateway support
Gateway | Policy version |
---|---|
DataPower® Gateway (v5 compatible) | 1.0.0 |
This topic describes how to configure the policy in your OpenAPI source; for details on how to configure the policy in the assembly user interface, see Activity Log.
About
- activity-log:
version: version
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 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 in the built-in policies section.
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
Properties
Property | Required | Description | Data type |
---|---|---|---|
version | Yes | The policy version number | string |
title | Yes | A title for the policy. | 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:
The default value is |
string |
error-content | No | Indicates what content to log if an error occurs. Valid values:
The default value is |
string |
Example 1
# use defaults
- activity-log:
version: 1.0.0
title: default activity logging
Example 2
- activity-log:
version: 1.0.0
title: no logging for successful calls
content: none
error-content: activity