Skip to content

add logging#160

Merged
salazarsebas merged 3 commits intoHarmonia-Development:mainfrom
DanielEmmanuel1:feat/logging
Oct 3, 2025
Merged

add logging#160
salazarsebas merged 3 commits intoHarmonia-Development:mainfrom
DanielEmmanuel1:feat/logging

Conversation

@DanielEmmanuel1
Copy link
Contributor

@DanielEmmanuel1 DanielEmmanuel1 commented Oct 2, 2025

feat: add structured logging to stellar wallet service

Closes #142
This PR introduces structured, centralized logging for the Stellar Wallet service to improve debugging, monitoring, and auditing.

  • Added winston and configured JSON logging with timestamps to console and logs/app.log
  • Implemented loggerMiddleware to log all requests/responses (method, URL, status, duration, user_id)
  • Replaced ad-hoc console errors with structured logs across critical paths:
    • src/stellar/sign.ts (transaction signing)
    • src/routes/kyc.ts (KYC submission)
    • src/routes/kyc-verify.ts (Soroban registration)
    • src/routes/wallet.ts (account creation and funding)
  • Applied middleware early in src/index.ts
  • Added LOG_LEVEL env var (default info) and ignored logs/ in git
  • Added unit test tests/middlewares/logger.test.ts with mocked Winston
    Notes
  • Sensitive data is not logged; user_id included when available
  • CI: lint and tests pass locally on feat/logging

@DanielEmmanuel1 DanielEmmanuel1 marked this pull request as ready for review October 2, 2025 23:06
@salazarsebas salazarsebas self-requested a review October 3, 2025 14:55
Copy link
Contributor

@salazarsebas salazarsebas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@salazarsebas salazarsebas merged commit 7980890 into Harmonia-Development:main Oct 3, 2025
4 checks passed
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 Logging for Stellar Wallet Service [wallet - service]

2 participants

Comments