Always logged
The gateway records this data for every request:- HTTP method, host, and path
- Status code
- Request ID and timestamp
- Deployment and instance identifiers
- Region
- Latency breakdown
Opt-in capture
A logging policy has five independent settings. Each one adds data to the log entries of matched requests:
The request headers setting includes the user agent and client IP because they identify the client. Query data is a separate setting because URLs can contain secrets, for example
?api_key=....
If more than one enabled logging policy matches a request, the gateway combines their settings.
The gateway redacts sensitive values before it stores them. It always redacts the Authorization header. It also redacts headers and query parameters that carry API keys for the API key policy.
Redact body fields
When an OpenAPI validation policy matches a request, the logging policy readsx-unkey-redact from the OpenAPI specification.
Set x-unkey-redact: true on a sensitive JSON property. The gateway replaces
its value with [REDACTED] in stored request and response bodies.
x-unkey-redact when a field does not need redaction. A value of false
has the same effect. The gateway always redacts authorization headers and
credentials that a KeyAuth policy defines.
View logs
You can see the logs in the Requests tab of your project in the Unkey dashboard. You can filter by:- Status code
- HTTP method
- Path
- Deployment
- Environment