Skip to content

Logging ​

src/lib/logger.js is a small levelled logger with no dependencies.

EnvironmentFormat
productionOne JSON object per line: { level, time, message, …meta }
OtherHuman-readable: [time] LEVEL message { meta }

Levels: debug < info < warn < error. Set LOG_LEVEL to change the threshold (default info, or error under NODE_ENV=test).

Error objects in metadata are serialised to { name, message, code, stack }.

js
logger.error('Escrow release outcome unknown', { tradeId, err });

HTTP logs ​

Morgan logs requests (dev format locally, combined in production). It's disabled in tests.

Messages worth alerting on ​

MessageMeaning
Escrow lock outcome unknownLock submission failed ambiguously; reconciliation will settle it
Escrow release outcome unknown / Escrow refund outcome unknownSame, for release/refund
Trade reconciliation failedReconciliation threw — usually Horizon unavailable
Escrow closed without a recognised transactionNeeds manual investigation
Auto-cancel failedA timeout refund failed; it retries next tick
Horizon request failedHorizon unreachable

What's never logged ​

Wallet secrets, passwords, raw tokens and full ID numbers.

Nexlm is a peer-to-peer facilitator and never holds customer Naira.