Skip to content

Standardize Audit Logging #75

Description

@nursetechie

Issue #35 — refactor: Standardize Audit Logging

Description

For sensitive financial and security operations, standard debug logs are insufficient. Immutable, structured audit logs provide an undeniable trail of actions (e.g., failed logins, wallet withdrawals), essential for compliance and forensic investigations.


Requirements & Context

Architectural Goal: Separate critical business audits from noisy debug logs.

Implementation Expectations: Create a lightweight Audit Logger service. Inject it into critical pathways (Registration, Password Reset, Withdrawals, Escrow Intents).

Format: Ensure logs output structured JSON detailing the User ID, action performed, timestamp, and IP address.


Acceptance Criteria

  • Distinct audit logs are reliably generated for high-value actions.
  • Audit logs contain the necessary context for forensic review without logging passwords.

Out of Scope

  • Database-backed audit trails (writing logs to stdout is sufficient for external log aggregators).

Suggested Execution

git checkout -b refactor/audit-logging

Suggested Commit Message

refactor: abstract and implement standardized audit logging

Testing Notes

  • Perform a withdrawal and inspect the stdout to verify the specific audit JSON payload is formed correctly.

References

Node.js structured logging best practices.


Definition of Done

  • Ready for review.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions