Configuration Reference
A complete reference for every DEX configuration option and its DEX_* environment variable.
This page documents the full configuration surface in Dex\\Config\\Dex and the matching DEX_* environment variables.
All options are optional — if you don’t set an environment variable, DEX uses its default.
Core switches & routing
enabled- Env:
DEX_ENABLED - Type:
bool - Default:
true - Notes: Turns DEX on/off globally.
- Env:
routePrefix- Env:
DEX_ROUTE_PREFIX - Type:
string - Default:
dex - Notes: URL prefix used by the dashboard routes.
- Env:
requestIdHeader- Env:
DEX_REQUEST_ID_HEADER - Type:
string - Default:
X-Request-Id - Notes: Header to read/write request IDs.
- Env:
Production access controls
allowInProduction- Env:
DEX_ALLOW_IN_PRODUCTION - Type:
bool - Default:
false - Notes: Blocks the UI in
productionunless enabled.
- Env:
uiEnabled- Env:
DEX_UI_ENABLED - Type:
bool - Default:
true - Notes: Master switch for the UI routes.
- Env:
uiAllowlist- Env:
DEX_UI_ALLOWLIST - Type:
string - Default:
127.0.0.1,::1 - Notes: Comma-separated list of IPs / CIDR ranges allowed to access the UI.
- Env:
allowedIPs- Env:
DEX_ALLOWED_IPS - Type:
array - Default:
[] - Notes: Optional exact-match IP allowlist. If non-empty, the client IP must be in this list and pass
uiAllowlist. Deprecated: useuiAllowlistinstead. This will be removed in a future major release.
- Env:
uiStealthDeny- Env:
DEX_UI_STEALTH_DENY - Type:
bool - Default:
true - Notes: When denied, return
404(stealth) instead of403.
- Env:
Error capture
captureUnhandledExceptions- Env:
DEX_CAPTURE_UNHANDLED_EXCEPTIONS - Type:
bool - Default:
true - Notes: Registers a global exception handler to capture unhandled exceptions.
- Env:
captureShutdownFatals- Env:
DEX_CAPTURE_SHUTDOWN_FATALS - Type:
bool - Default:
true - Notes: Captures fatal shutdown errors (
E_ERROR,E_PARSE, etc.).
- Env:
Request snapshots
Request snapshots are stored as JSON on the request row when DEX stores the request.
captureRequestSnapshots- Env:
DEX_CAPTURE_REQUEST_SNAPSHOTS - Type:
bool - Default:
true - Notes: Stores a request snapshot JSON alongside lifecycle JSON.
- Env:
snapshotProfile- Env:
DEX_SNAPSHOT_PROFILE - Type:
string - Default:
full - Notes:
fullorminimal. Minimal stores a smaller subset.
- Env:
maxSnapshotBytes- Env:
DEX_MAX_SNAPSHOT_BYTES - Type:
int - Default:
48000 - Notes: Hard cap for stored snapshot JSON size.
- Env:
snapshotIncludeInputKeys- Env:
DEX_SNAPSHOT_INCLUDE_INPUT_KEYS - Type:
bool - Default:
true - Notes: Stores input key names (GET/POST/FILES), not values.
- Env:
snapshotMaxKeys- Env:
DEX_SNAPSHOT_MAX_KEYS - Type:
int - Default:
200 - Notes: Max keys per input group (GET/POST/FILES).
- Env:
snapshotIncludeHeaders- Env:
DEX_SNAPSHOT_INCLUDE_HEADERS - Type:
bool - Default:
true - Notes: Stores request headers in snapshot (sensitive headers are excluded).
- Env:
snapshotHeaderAllowlist- Env:
DEX_SNAPSHOT_HEADER_ALLOWLIST - Type:
array - Default:
[] - Notes: If provided, only these header names are included (case-insensitive).
- Env:
Noise controls & internal traffic
maxOccurrencesPerMinute- Env:
DEX_MAX_OCCURRENCES_PER_MINUTE - Type:
int - Default:
30 - Notes: Rate limit per fingerprint per minute. Set
0to disable.
- Env:
ignoreSelfRoutes- Env:
DEX_IGNORE_SELF_ROUTES - Type:
bool - Default:
true - Notes: Ignores DEX UI routes so DEX doesn’t record itself.
- Env:
ignorePathPrefixes- Env:
DEX_IGNORE_PATH_PREFIXES - Type:
array - Default:
[] - Notes: Path prefixes to ignore (e.g.
["/health", "/metrics"]).
- Env:
botUserAgentBlocklist- Env:
DEX_BOT_USER_AGENT_BLOCKLIST - Type:
array - Default: (built-in list)
- Notes: If the request UA contains one of these tokens, DEX won’t run.
- Env:
ignoreNamespaces- Env:
DEX_IGNORE_NAMESPACES - Type:
array - Default:
["Dex\\\\"] - Notes: Exceptions originating from these namespaces won’t be captured.
- Env:
Breadcrumbs, spans, and lifecycle timeline
captureLifecycle- Env:
DEX_CAPTURE_LIFECYCLE - Type:
bool - Default:
true - Notes: Enables the lifecycle timeline collection.
- Env:
maxLifecycleItems- Env:
DEX_MAX_LIFECYCLE_ITEMS - Type:
int - Default:
220 - Notes: Caps the number of lifecycle items stored per request.
- Env:
maxLifecycleBytes- Env:
DEX_MAX_LIFECYCLE_BYTES - Type:
int - Default:
128000 - Notes: Hard cap for stored lifecycle JSON size.
- Env:
maxLifecycleItemDataBytes- Env:
DEX_MAX_LIFECYCLE_ITEM_DATA_BYTES - Type:
int - Default:
6000 - Notes: Caps the size of per-item metadata before storing.
- Env:
slowRequestMs- Env:
DEX_SLOW_REQUEST_MS - Type:
int - Default:
1000 - Notes: Marks stored requests as “slow” when duration meets/exceeds this threshold.
- Env:
slowQueryMs- Env:
DEX_SLOW_QUERY_MS - Type:
int - Default:
100 - Notes: Marks DB queries as “slow” in the lifecycle timeline.
- Env:
maxSqlLength- Env:
DEX_MAX_SQL_LENGTH - Type:
int - Default:
4000 - Notes: Trims captured SQL strings to this many characters.
- Env:
captureBreadcrumbs- Env:
DEX_CAPTURE_BREADCRUMBS - Type:
bool - Default:
true - Notes: Enables breadcrumbs.
- Env:
captureSpans- Env:
DEX_CAPTURE_SPANS - Type:
bool - Default:
true - Notes: Enables spans.
- Env:
captureCiLifecycle- Env:
DEX_CAPTURE_CI_LIFECYCLE - Type:
bool - Default:
true - Notes: Enables CI lifecycle checkpoints/spans (route matched, controller span, etc.).
- Env:
captureCiLifecycleBreadcrumbs- Env:
DEX_CAPTURE_CI_LIFECYCLE_BREADCRUMBS - Type:
bool - Default:
true - Notes: Adds a breadcrumb for certain CI events.
- Env:
If you need hard caps, rely on
maxLifecycleItems and the JSON byte limits.
Redaction / scrubbing
scrubFields- Env:
DEX_SCRUB_FIELDS - Type:
array - Default: (password/token list)
- Notes: Field names that will be redacted from stored payloads and snapshots.
- Env:
Occurrence HTTP context
captureHttpOnError- Env:
DEX_CAPTURE_HTTP_ON_ERROR - Type:
bool - Default:
true - Notes: Captures compact HTTP context when an exception is stored.
- Env:
captureRequestHeadersOnError- Env:
DEX_CAPTURE_REQUEST_HEADERS_ON_ERROR - Type:
bool - Default:
false - Notes: When enabled, includes request headers in occurrence HTTP context.
- Env:
maxCapturedHeaders- Env:
DEX_MAX_CAPTURED_HEADERS - Type:
int - Default:
40 - Notes: Max headers stored when header capture is enabled.
- Env:
maxCapturedHeaderValueLength- Env:
DEX_MAX_CAPTURED_HEADER_VALUE_LENGTH - Type:
int - Default:
800 - Notes: Trims header values to this length.
- Env:
Data purging (retention)
DEX includes a purge job you can run via CLI: php spark dex:purge.
purgeEnabled- Env:
DEX_PURGE_ENABLED - Type:
bool - Default:
true - Notes: Enables the purge job.
- Env:
purgeBatchSize- Env:
DEX_PURGE_BATCH_SIZE - Type:
int - Default:
500 - Notes: Delete batch size (per loop).
- Env:
purgeMaxRuntimeSeconds- Env:
DEX_PURGE_MAX_RUNTIME_SECONDS - Type:
int - Default:
20 - Notes: Safety cap for one purge run.
- Env:
purgeRetentionDaysRequests- Env:
DEX_PURGE_RETENTION_DAYS_REQUESTS - Type:
int - Default:
14 - Notes: TTL for request rows.
- Env:
purgeRetentionDaysOccurrences- Env:
DEX_PURGE_RETENTION_DAYS_OCCURRENCES - Type:
int - Default:
30 - Notes: TTL for occurrences.
- Env:
purgeRetentionDaysIssues- Env:
DEX_PURGE_RETENTION_DAYS_ISSUES - Type:
int - Default:
90 - Notes: TTL for issues.
- Env:
purgeMaxRowsRequests- Env:
DEX_PURGE_MAX_ROWS_REQUESTS - Type:
int - Default:
100000 - Notes: Row cap safety net (keeps newest rows).
- Env:
purgeMaxRowsOccurrences- Env:
DEX_PURGE_MAX_ROWS_OCCURRENCES - Type:
int - Default:
200000 - Notes: Row cap safety net (keeps newest rows).
- Env:
purgeMaxRowsIssues- Env:
DEX_PURGE_MAX_ROWS_ISSUES - Type:
int - Default:
50000 - Notes: Row cap safety net (keeps newest rows).
- Env:
purgeUseDbLock- Env:
DEX_PURGE_USE_DB_LOCK - Type:
bool - Default:
true - Notes: Use DB-level lock to avoid concurrent purges.
- Env:
purgeDbLockName- Env:
DEX_PURGE_DB_LOCK_NAME - Type:
string - Default:
dex_purge - Notes: Lock name used by the purge job.
- Env: