sendgrid-nodejs icon indicating copy to clipboard operation
sendgrid-nodejs copied to clipboard

set custom logger?

Open soryy708 opened this issue 3 months ago • 0 comments

Given a service that uses @sendgrid/mail and a few other things, I'd like its logger output to be consistent, to make it easier to consume, aggregate, and send to a logs stream for indexing. (For example, I may want each log entry to be a single line in JSON format (making stdout act like JSONL))

However, in some warning/error cases this SDK writes directly to console, so I can't change the output format?

This leads to "Unparsed logs" showing up in Datadog, looking like for example:

Content with characters ', " or & may need to be escaped with three brackets {{{ content }}} See https://sendgrid.com/docs/for-developers/sending-email/using-handlebars/ for more information.

soryy708 avatar Sep 11 '25 12:09 soryy708