API logs
Learn more about viewing and debugging API request logs in Knock.
Knock automatically captures and stores all of the API requests you make to the Knock API, and makes these requests accessible under the Observability > Logs section of the Knock dashboard. Knock does not store response bodies for the /feeds endpoint in its logs.
Filtering API logs
#You can filter API logs in your Knock account using the following filters:
- Request ID. Filter for a particular log returned by the
X-Request-IDheader. - Status. Filter for failed and succeeded requests.
- Endpoint type. Filter for requests to particular sets of endpoints.
Log truncation
#Knock truncates logs with long binaries, lists, maps, and strings to prevent the logs from becoming too large. The truncation occurs at the top level of the JSON object and is noted by the presence of either the __knock_truncated__ key in the JSON object (indicating that some of the keys were dropped) or as a [TRUNCATED] value under a given key.
Filtered values
#Before Knock stores an API log, it replaces the values of sensitive keys in the query parameters, request body, and response body with [filtered]. Knock filters some common sensitive keys, such as password, api_key, and email, by default. You can add your own key names as filtered log keys.
Knock filters these values when it writes the log, so it can't recover them later. Logs written before you add a filtered log key keep the original value.
The log detail view also shows the request headers. Knock replaces the values of sensitive headers, such as Authorization, Cookie, and X-Api-Key, with [filtered]. Filtered log keys don't apply to headers.