Skip to content

Add secure structured API logging - #17

Merged
Alidantech merged 4 commits into
chatgpt/developfrom
chatgpt/structured-logging
Jul 18, 2026
Merged

Add secure structured API logging#17
Alidantech merged 4 commits into
chatgpt/developfrom
chatgpt/structured-logging

Conversation

@Alidantech

Copy link
Copy Markdown
Contributor

Summary

  • replace sentence-based logs with compact typed REQ/RES/ERR/RETRY/CACHE/AUTH events
  • add production-safe global levels and immutable client-only per-call logging options
  • centralize bounded mandatory redaction before default or custom logger sinks
  • log each operation once with concise retries, total duration, and network/cache source
  • document configuration, debugging, migration, redaction, and custom sinks

Public API

  • ApiLoggingLevel: none, errors, basic, detailed
  • ApiCallLogOptions through ApiRequestOptions.log
  • typed request/response/error/retry/cache/auth event subclasses
  • ApiLogFormatter and CallbackApiLogger

Existing ApiLogger, ApiLogEvent, ApiLogLevel, ApiLoggingConfig.enabled, and legacy metadata booleans remain supported.

Security

Mandatory redaction covers credentials, tokens, authorization, cookies, secrets, API keys, OTP/PIN values, signed URL parameters, nested structures, long values, cycles, binary data, streams, and multipart uploads. Logger failures cannot affect requests or authentication transitions.

Validation

  • dart format --output=none --set-exit-if-changed .
  • flutter analyze
  • flutter test (36 passed)
  • flutter analyze in example
  • dart pub publish --dry-run (0 warnings)

Generator boundary

Runtime forwarding support is complete. Direct log: parameters on generated operations require the external generator/templates intentionally absent from this repository and remain tracked in #15.

Closes #14
Closes #16
Refs #15

@Alidantech
Alidantech merged commit fa47395 into chatgpt/develop Jul 18, 2026
0 of 2 checks passed
@Alidantech
Alidantech deleted the chatgpt/structured-logging branch July 18, 2026 20:35
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.

1 participant