Log Invocation
This policy enables logging requests or responses to a specified destination. This action also logs other information about the requests or responses, such as the API name, operation name, the Integration Server user, a timestamp, and the response time.
In API Studio, this policy is identified by the kind Log
.
Here is a sample code for the Log Invocation policy.
kind: Log
apiVersion: api.webmethods.io/beta
metadata:
name: log_invocation
version: 1.0
namespace: sample
tags:
- log_invocation
spec:
enabled: true
logRequestHeaders: true # default value is false
logResponseHeaders: true # default value is false
logRequestPayload: true # default value is false
logResponsePayload: true # default value is false
compressPayloads: true # default value is false
logGenerationFrequency: always #Other values are 'onfailure' & 'onsuccess'
destination:
- self
- dev_portals:
- devportal 1 #name of the portal instance in the gateway
- email:
- nas@sag.com
- daso@sag.com
The structure in the code view and what it denotes is as follows:
Type | Description |
---|---|
kind | Log. This denotes the asset type, Log policy. |
apiVersion | This denotes the API version of the API on which this policy is enforced. |
metadata | This denotes the metadata or details of the asset type. It covers the following metatdata:
|
spec | This denotes various policy properties you can configure for the policy. You can
configure the following policy properties:
|