日志与审计

日志与审计

Request log fields and how they connect API activity to company credentials.

分享

Request log fields and how they connect API activity to company credentials.

持久化字段

FieldDescription
methodHTTP method.
pathOriginal URL with query string.
normalizedPathPath without query string.
statusCodeFinal HTTP status.
durationMsRequest duration in milliseconds.
profileIdResolved Developer Profile (internal Mongo id, kept for relations and audit).
profileCodeResolved Developer Profile code (dp_ prefix) sent in X-Travelandz-Id.
profileKeyPublic key used by the request.
credentialIdEmbedded credential/API key _id; preferred key for API-key audit views.
companyIdAssociated company.
ipExpress-resolved IP; depends on TRUST_PROXY.
originHostname from Origin or Referer.
userAgentUser agent.
requestIdPublic Travelandz request id returned as request_id in error bodies and X-Travelandz-Request-Id in response headers when available.
gdsproviderProvider inferred from the path when applicable.
providerInternal provider/source identifier for support and audit only. This value is never returned in public error JSON.
providerRequestIdExternal-source request id, if one was provided upstream. Kept internally only.
providerErrorCodeExternal-source error code captured for support matching.
providerErrorTypeExternal-source error type captured for support matching.
providerStatusExternal-source HTTP status captured for support matching.
travelandzErrorCodeTravelandz public error code selected by the normalization layer.
errorCodeStructured error code when present in the response.
errorMessageShort error message.
requestContentLengthRequest content length.
responseContentLengthResponse content length.

Credential traceability

Use credentialId for exact joins between dashboard credentials and logs. Use profileKey when the UI only has the public key, or when diagnosing historical records created before credential identifiers were surfaced.

Security

Public error responses must only include code, message and request_id when normalized. Logs must never include Authorization, bearer tokens, decrypted secret keys or raw third-party provider credentials.