Skip to content

pwmckenna/bunyan-newrelic-stream

Repository files navigation

bunyan-newrelic-stream

This library will send error logs to your newrelic account. It assumes that your application has a newrelic config file all set up.

import NewRelicStream from 'bunyan-newrelic-stream';
bunyan.createLogger({
  ...
  streams: [{
    level: 'error',
    type: 'raw',
    stream: new NewRelicStream()
  }]
});

What data is sent to newrelic?

Whatever is in err. If you log an error directly logger.trace(new Error()), or via the err key logger.trace({ err: new Error() }), this library will receive the serialized contents of that error. This is generally done by the standard bunyan error serializer, but can be configured via the serializers option passed into bunyan. I recommend https://github.com/pwmckenna/bunyan-error-serializer :)

About

Send bunyan error logs to your NewRelic account.

Resources

Stars

Watchers

Forks

Packages

No packages published