Skip to main content

Request Logs

Zerq logs every API request with full details — headers, body, latency, status, client identity, and more. Credential values are redacted before an entry is stored (see Automatic redaction). Use the Logs section to debug issues, investigate clients, and trace specific requests.

Request log guides​

What's logged​

Every request log entry includes:

FieldDescription
Request IDUnique identifier for tracing (also returned in X-Request-ID header)
Trace IDOpenTelemetry trace ID when tracing is on (also returned in the X-Trace-ID header); links to your tracing UI when NEXT_PUBLIC_TRACE_URL_TEMPLATE is set
TimestampWhen the request arrived
MethodHTTP method (GET, POST, etc.)
PathThe incoming request path
RouteThe matched endpoint: the collection's base path and the proxy's path template, for example /shop/orders/{id} (empty when no proxy matched). The dashboard groups endpoints by it.
Target endpointThe backend URL the request was forwarded to (credential-looking query parameters masked)
Status codeHTTP response status
LatencyEnd-to-end response time in milliseconds
Client IDWhich client made the request
Profile IDWhich profile was used
CollectionWhich collection was matched
Client IPSource IP address
Request headersRequest headers; credential header values replaced with [REDACTED]
Request bodyRequest payload, with secret fields masked
Response headersResponse headers; credential header values (for example Set-Cookie) replaced with [REDACTED]
Response bodyResponse payload, with secret fields masked; streamed responses are stored as [streamed]
ErrorWhy the gateway rejected or failed the request; for upstream failures, the operator-facing cause

Logging and metrics assumptions​

Request logs are captured through an asynchronous logging path for runtime performance. In failure conditions (for example abrupt process termination), a small subset of in-flight log writes may be delayed or dropped.

The management UI dashboard is derived from logged request data, so its completeness depends on logging health. Prometheus metrics are recorded independently of the log write, and zerq_logs_writes_total{result="error"} counts log entries that could not be stored.

Which requests are logged​

Every gateway request is logged, including requests rejected by authentication, 429 rate-limit and quota refusals, response-cache hits and idempotent replays. A caller-supplied X-Proxy-ID header no longer excludes a request from the log.

Automatic redaction​

The gateway masks credentials before a log entry is written. The header or field name is kept, so you can still see that it was sent; only the value is replaced with [REDACTED].

WhatRedacted
Request and response headersAuthorization, Proxy-Authorization, Cookie, Set-Cookie, X-API-Key, X-Idempotency-Key / Idempotency-Key, forwarded client-certificate headers (X-SSL-Client-Cert, X-Forwarded-Client-Cert, ...), any header whose name contains token, secret, api-key, apikey, password or private-key, ends in -key / _key, or has a name segment auth, jwt, assertion, signature, session or credential(s) (for example X-Auth-Token, X-Hub-Signature-256, X-Session-Id)
URLs (target endpoint, Location, Content-Location, Referer)Values of query parameters with credential-looking names, such as an upstream API key injected with key_in=query (key, sig, signature, code, pwd, pass, plus the header-name rules above)
JSON bodiesValues of fields such as password, secret, client_secret, private_key, api_key, token, access_token, refresh_token, id_token, connection_string, authorization, cookie, and fields ending in _secret, _key, _token, _password, _certificate, _connection_string (any naming style, for example clientSecret)
URL-encoded form bodiesValues of parameters matching the query-parameter rules (for example an OAuth2 password grant's password)

Masked values are not stored, so payload search cannot find them. Other body formats (XML, plain text, binary) are stored unchanged.

When the gateway answers with a generic error for an upstream failure (for example 502 because the upstream was unreachable or its stored credential could not be applied), the API caller sees only the generic message. The Error field holds the operator-facing cause, with the query string and user info stripped from any upstream URL.

Data handling​

Request logs can contain sensitive payload content. Treat them as controlled data.

  • Avoid sending secrets, raw credentials, or highly sensitive PII in request/response bodies.
  • Automatic redaction covers common credential names only. Apply token and secret masking in upstream systems for anything else that is sensitive.
  • Use role-based access for log viewers and keep access scoped to least privilege.
  • Define retention periods based on compliance requirements and internal policy (REQUEST_LOG_RETENTION_DAYS), and use a proxy's Request logging level to keep bodies or headers out of the log where they are not needed. See Log Streaming and Retention.
  • If sensitive data is logged accidentally, remove the record promptly and rotate affected credentials.

Viewing logs​

  1. Go to Logs in the sidebar
  2. Logs are displayed in reverse chronological order
  3. Click any log entry to see the full detail modal with all headers and bodies

Filtering logs​

Use the filter panel to narrow down logs:

By content​

FilterDescriptionExample
PathMatch by incoming path, supports wildcards/payments/transactions, /payments/*
RouteExact route template (set by the dashboard's endpoint links)/shop/orders/{id}
MethodHTTP methodGET, POST, PUT, DELETE, PATCH
Status codeExact code or class200, 4xx, 5xx
Client IDFilter to one specific clientUUID from the client detail page
Profile IDFilter to one profileUUID from the profile detail page
Client IPSource IP address192.168.1.100
Request IDFind a specific request by trace IDUUID returned in X-Request-ID response header
Target endpointBackend URL the request was forwarded tohttps://api.upstream.internal/charges
PayloadFull-text search across both request body and response body simultaneously"error": "invalid_token"
CollectionFilter to one collectionSelect from dropdown

Payload search — the payload filter searches both the request body and the response body in a single query. This is especially useful for finding specific error messages, correlation IDs, or field values without knowing which end of the transaction they appear on.

By latency​

Set a latency threshold using an operator and a value in milliseconds:

OperatorEffectExample
> (greater than)Show only slow requests> 500 — requests taking more than 500ms
< (less than)Show only fast requests< 100 — requests completing under 100ms
= (equals)Find requests at an exact latencyRarely used; mainly for debugging

By time​

Preset
Last 1 hour
Last 24 hours
Last 7 days
Last 30 days
Custom rangeSelect start and end date/time

All active filters are written into the browser URL as query parameters. This means:

  • You can bookmark a filtered view and return to it later
  • You can share a URL with a team member and they see exactly the same filtered results
  • The Dashboard's View Logs deep link exploits this — it opens request logs pre-filtered for a specific endpoint and time window by constructing a URL with the right parameters

Log detail view​

Click any log entry to open the full detail dialog:

  • Request headers — all headers sent by the client
  • Request body — the full request payload, pretty-printed if JSON
  • Response headers — all headers returned by the gateway/upstream
  • Response body — the full response, pretty-printed if JSON
  • Error message — if the gateway rejected the request, the reason is shown here; for upstream failures, the sanitised cause that the API caller does not see
  • Metadata — latency breakdown, client ID, profile ID, matched collection and proxy, target URL, client IP, request ID, trace ID (a link to the trace when configured)

Pagination​

Configure how many logs appear per page: 10, 25, 50, or 100 entries. Use the pagination controls to navigate through results.

Sorting​

Sort by any column — timestamp, latency, status code, method — ascending or descending.

Use cases​

Debugging a client issue​

  1. Filter by Client ID to see only that client's requests
  2. Filter by Status code 4xx or 5xx to find failures
  3. Click into a failed request to see the full response body (error message from backend)

Investigating slow responses​

  1. Filter Latency > 1000ms to find requests over 1 second
  2. Sort by latency descending
  3. Identify which endpoints are consistently slow

Tracing a specific request​

If a user reports an issue and gives you a request ID or trace ID (X-Request-ID / X-Trace-ID response headers):

  1. Filter by Request ID or Trace ID
  2. See the exact request, response, timing, and client identity
  3. Open the trace to see where the time went (gateway vs upstream)

Compliance review​

Filter by time range to export all requests for a compliance review period. Check which clients called which endpoints, with what payloads.

Log retention​

Configure log retention in the gateway settings. For compliance-regulated environments, set a retention period that meets your regulatory requirements (e.g., 90 days, 1 year).

Deleting logs​

Admin users can delete individual log entries if needed (e.g., to remove PII).