Skip to content

feat: structured startup log for loaded config summary#435

Merged
Chucks1093 merged 1 commit into
accesslayerorg:mainfrom
extolkom:feat/startup-config-summary-log
Jun 23, 2026
Merged

feat: structured startup log for loaded config summary#435
Chucks1093 merged 1 commit into
accesslayerorg:mainfrom
extolkom:feat/startup-config-summary-log

Conversation

@extolkom

@extolkom extolkom commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

closes #194

Summary

Adds a structured startup log that summarizes the loaded runtime configuration —
the environment context and key feature flags — emitted once when the server boots.

Previously the startup config log dumped the entire masked env config as a flat
object. This replaces it with a curated, grouped summary that is easier for
operators to scan, while guaranteeing no secrets are logged.

What changed

  • New buildStartupConfigSummary() (src/utils/config-summary.utils.ts) —
    returns a grouped { environment, featureFlags } object:
    • environment: mode, port, apiVersion, stellarNetwork, backendUrl, frontendUrl
    • featureFlags: the key ENABLE_* toggles + ownership-snapshot cleanup flag
  • src/server.ts — logs the structured summary at startup
    (logger.info(buildStartupConfigSummary(), 'Loaded runtime configuration summary'))
    instead of the flat full-config dump.
  • Tests (src/utils/config-summary.utils.test.ts) — assert the env + flag
    values, that only those two groups are exposed, and that no sensitive values
    leak into the output.
  • Docs (docs/configuration.md) — new "Startup Configuration Summary" section
    with example output and local-validation steps.

No secrets logged

Values are sourced through the existing maskSensitiveConfigValues() helper, and
only non-sensitive keys are selected. Secrets, passwords, API keys, tokens, and
the DATABASE_URL credentials are never included in the summary.

Example output

{
  "level": 30,
  "msg": "Loaded runtime configuration summary",
  "environment": {
    "mode": "development",
    "port": 3000,
    "apiVersion": "1.0.0",
    "stellarNetwork": "testnet",
    "backendUrl": "http://localhost:3000",
    "frontendUrl": "http://localhost:5173"
  },
  "featureFlags": {
    "responseTiming": true,
    "apiVersionHeader": true,
    "schemaVersionHeader": true,
    "requestLogging": true,
    "indexerDedupe": true,
    "indexerDlq": true,
    "indexerCursorStalenessWarning": true,
    "ownershipSnapshotCleanup": false
  }
}
How to validate locally
pnpm install && pnpm exec prisma generate
pnpm dev
Look for the Loaded runtime configuration summary line in the startup output and confirm no secret values appear.
Testing
pnpm jest src/utils/config-summary.utils.test.ts → passing
pnpm build (tsc) → clean
pnpm exec eslint on changed files → clean
Scope
Limited to the config-summary feature: 2 new files (util + test), 2 modified
(server.ts, docs/configuration.md). No unrelated file churn.
closes #194 

Emit a grouped {environment, featureFlags} summary of the loaded runtime
config at startup instead of dumping the full masked config object. Values
are sourced through the existing masking helper and only non-sensitive keys
are selected, so no secrets are logged.

Adds config-summary.utils.ts + tests and documents the summary and local
validation steps in docs/configuration.md.
@Chucks1093 Chucks1093 merged commit 3e3c5ad into accesslayerorg:main Jun 23, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add structured startup log for loaded config summary

2 participants