A bunyan-compatible stream interface that sends error logs to raven-node.
First, create your raven-node client as usual:
var raven = require'raven'client = "___YOUR_SENTRY_DSN__OR_DEFER_TO_env.SENTRY_DSN___";clientpatchGlobal; // optional
Then when you create your node-bunyan logger, include an instance of the
RavenStream as well and configure it to match your desired logging level:
var bunyan = require'bunyan'RavenStream = require'bunyan-raven';var logger = bunyancreateLoggername: 'test logger'// IMPORTANT PART:streams:type: 'raw'stream: clientlevel: 'error';
RavenStream will automatically logs any error objects if it is passed in the
of the log record or will simply creates a new Error object with the log record's message.
PRs welcome. Bug reports/assistance, just file a GitHub issue.