API Gateway 10.15 | Getting Started with API Gateway | API Transaction Logging
 
API Transaction Logging
Why API Transaction Logging?
You can enable transaction logging for API to record and view the activities of your API. This record keeps a track of when an event occurred, why it occurred and what was impacted. The audit logs provide a detailed record of various auditable events of an API such as user login and logout details and the user responsible for it. By logging the transactions of the API, you can learn more about API activities, which may be useful for troubleshooting if something goes wrong.
API Gateway has the capability to log transactions and capture data of various auditable events of APIs. By default, API Gateway does not log the transactions. You must enable transaction logging so that the log data for the API to view the analytics of the API and detect anomalies.
This section describes how to activate the online_petstore API in API Gateway, enable transaction logging of the API, and view the logs and analytics at the API level.
Before you begin
Ensure the API you are working with is created and enforced with the required policies.
1. Ensure petstore API is activated.
Before enabling audit API, you must first activate it so that the users can access the gateway localhost and use the API.
If the API is not in active state, perform the following steps:
a. Log onto your API Gateway instance.
b. Click APIs on the title navigation bar.
c. Select online_petsore API from the list of APIs and click to activate the API.
2. Enable transaction logging API
a. Click online_petstore > Policies.
b. Expand the traffic monitoring tab on the left pane.
c. Click Log Invocation.
d. Select the required Log Invocation policy properties in the right pane and select API Gateway as the destination.
You can choose to view the analytics data with or without the payload properties checked.
e. Click to save your changes.
Note: 
If you want to log multiple APIs for request-response, import the following policy template- <link>
However, if you want to apply the transaction logging changes to all the APIs, you can use a Global policy. For more information regarding global policies, see - Global Policies (softwareag.com)
3. View the analytics data
a. Go to Postman and invoke the online_petsore API using the GET call.
b. On the API Gateway instance, click APIs on the title navigation bar.
c. Select online_petstore API > API Analytics.
*Transaction logging data with Payload properties:
*Transaction logging data without Payload properties:
You will be able to see the transaction data in this section.
This chart specifies the number of events generated at a specific time. The analytics data remains the same regardless of whether the payload log invocation properties are checked or not.
The headers and the payload log data are saved when the payload properties are enabled. In this case, the size of the data will increase drastically.
If the payload properties are disabled, then only the headers will be saved. The size of the data will be minimal.
You can sort the data by selecting the required options in the filter.
To know more about API Analytics, see – API Gateway Dashboard (softwareag.com)