Skip to content

Replace console.log with structured logging #12

Description

@adambalogh

Description

There are 12+ console.log / console.error calls across production code paths in the facilitator packages. Some log sensitive data including transaction receipts and payer addresses.

Affected Files

  • typescript/packages/mechanisms/evm/src/exact/facilitator/eip3009.ts — logs transaction receipt
  • typescript/packages/mechanisms/evm/src/exact/facilitator/permit2.ts — logs transaction receipt
  • typescript/packages/mechanisms/evm/src/exact/v1/facilitator/scheme.ts — logs payer addresses, deployment errors, settlement errors

Impact

  • Sensitive data (payer addresses, tx details) written to stdout
  • No log levels — cannot filter debug vs error output
  • No structured format — difficult to parse in log aggregation systems
  • No correlation IDs — cannot trace requests across services

Fix

  1. Adopt a structured logging library (pino or winston)
  2. Remove all console.log / console.error calls from production code
  3. Add log levels (debug, info, warn, error) based on severity
  4. Ensure sensitive data (addresses, keys, full receipts) is redacted or excluded
  5. Add request correlation IDs for tracing

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions