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.
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
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:
Property | Required | Description | Type |
---|---|---|---|
success-content |
No | 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 when an error occurs. Valid values:
The default value is |
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