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
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
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
Out of Scope
Suggested Execution
Suggested Commit Message
Testing Notes
References
Node.js structured logging best practices.
Definition of Done