Skip to content

feat:Add structured logging with correlation IDs and centralized aggr…#471

Open
uboho-prog wants to merge 1 commit into
Smartdevs17:mainfrom
uboho-prog:structured-login
Open

feat:Add structured logging with correlation IDs and centralized aggr…#471
uboho-prog wants to merge 1 commit into
Smartdevs17:mainfrom
uboho-prog:structured-login

Conversation

@uboho-prog
Copy link
Copy Markdown

@uboho-prog uboho-prog commented May 28, 2026

Closes #439


…egation

Pull Request Checklist

Quality Gates (All must pass before merge)

  • Lint: Code passes ESLint and Prettier checks
  • Type Check: TypeScript compilation succeeds
  • Tests: All tests pass
  • Build: Project builds successfully
  • Rust Format: Smart contract formatting is correct
  • Rust Clippy: Smart contract linting passes
  • Rust Tests: All smart contract tests pass
  • Rust Build: Smart contracts compile successfully

Additional Requirements

  • New code has appropriate TypeScript types
  • No hardcoded secrets or credentials
  • New features have corresponding tests
  • Documentation updated if needed

Reviewers

  • At least 1 approval required for merge
  • All CI checks must be green

This PR will not be mergeable until all quality gates pass.


PR: Structured logging with correlation IDs and log query support

Summary

Implemented structured logging across backend and frontend services, added correlation ID propagation, PII redaction, module-level log level configuration, and a queryable in-memory log dashboard helper.

What changed

  • backend/services/logging.ts

    • Added structured JSON log output
    • Added async correlation ID propagation using AsyncLocalStorage
    • Added module-level log level configuration via BACKEND_LOG_LEVEL and BACKEND_LOG_LEVELS
    • Added PII redaction for sensitive metadata fields
    • Added optional remote log forwarding via LOG_REMOTE_ENDPOINT
    • Added in-memory log buffer and query helper
  • backend/services/loggingDashboard.ts

    • Added filtered log dashboard helper for queries and pagination
  • backend/services/index.ts

    • Exported getLogDashboard helper
  • backend/services/types.ts

    • Added optional correlationId to Alert
  • src/services/logging.ts

    • Added frontend structured logger implementation
  • src/services/gdpr.ts

    • Replaced plain console logging with structured logger calls
  • src/services/walletService.ts

    • Replaced plain console logging with structured logger calls
  • docs/api-logging.md

    • Documented centralized log aggregation and query usage
  • backend/services/__tests__/loggingDashboard.test.ts

    • Added coverage for filtered log dashboard query functionality

@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented May 28, 2026

@uboho-prog Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

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 logging with correlation IDs and centralized aggregation

1 participant