Node.js error capture from logs

I would like to get advice on whether my use case is a good fit for Sentry or not.

It’s a Node.js application but not Express or Koa-based. Generally, we do not have “uncaught” exceptions - nearly everything is caught and handled gracefully today via log.warn and log.error outputs that are sent to CloudWatch logs. Errors often originate from HTTP handlers so do not contain stack traces.

Except for when it’s a true uncaught exception, we always have:

  • A meaningful message (e.g. ‘failed to update foobar’)
  • Often, an ‘err’
  • Often, other non-err metadata that’s useful (such as a username)

Assuming that I have a handler that can intercept every log.warn and log.error, how would I shoehorn this existing logging/error approach into Sentry’s captureException and/or captureMessage?