log
Use the log policy to customize or override the default activity logging configuration for an API.
Gateway support
Gateway | Policy version |
---|---|
DataPower® API Gateway | 2.0.0 2.1.0 (DataPower API Gateway Version 10.0.3.0 or later) |
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 Log.
About
The log policy has the
following format:
- log:
version: version
title: title
description: description
mode: activity_logging_actions
log-level: type_of_content_to_log
Properties
The following table describes the properties of the log policy.
Property | Required | Description | Data type |
---|---|---|---|
version | Yes | The policy version number | string |
title | No | A title for the policy. | string |
description | No | A policy description. | string |
mode | Yes | Specify one of the following values:
If you use the Send-only or Gather-and-send option, data is buffered and sent to the analytics server in batches according to the time interval configured for the Analytics Endpoint on the DataPower API Gateway. For more information, see Configuring an analytics endpoint in the DataPower knowledge center. Note: If you are offloading to a third party analytics server, you can redact any aspect
of the event data. If you are using API Connect analytics, you can redact only request and response
payloads.
|
string |
log-level | No | The type of content to log. Specify one of the following values:
|
string |
Example
- log:
version: 2.0.0
title: Gather activity log data for processing
mode: gather-only