A healthtech app logging API must retain structured JSON logs that explain why an OTP failed to reach a customer without becoming a second store of sensitive messages. That constraint changes what deserves a log entry. More events can make the evidence worse if routine retries bury the transition that explains the incident.
TL;DR: emit structured JSON from the app, preserve request_id and user_id across the delivery workflow, and send the sanitized records to centralized ingestion and search. For a Node.js application, evaluate Pino or Winston at the emission layer; choose the backend separately. Keep trace_id and span_id as correlation fields unless a tracing system actually supplies the investigation tools.…