# @mcph/bunyan-raven

> A bunyan-compatible stream interface that sends error logs to raven-node.

Latest version **1.2.1** (published 2018-01-04) · BSD-2-Clause license · 0 weekly downloads

## Install

```sh
npm install @mcph/bunyan-raven
pnpm add @mcph/bunyan-raven
yarn add @mcph/bunyan-raven
bun add @mcph/bunyan-raven
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.2.1 |
| Published | 2018-01-04 |
| First published | 2017-07-12 |
| Weekly downloads | 0 |
| License | BSD-2-Clause |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >=6 |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | mcph |
| Keywords | typescript, bunyan, raven, error-logging, getsentry |

## Links

- npm: https://www.npmjs.com/package/@mcph/bunyan-raven
- Repository: https://github.com/mixer/bunyan-raven
- Homepage: https://github.com/mixer/bunyan-raven#readme
- Issues: https://github.com/mixer/bunyan-raven/issues
- npm.io page: https://npm.io/package/@mcph/bunyan-raven

## Alternatives

- [cli-color](https://npm.io/package/cli-color.md) — 3.4M weekly downloads
- [log](https://npm.io/package/log.md) — 1.3M weekly downloads
- [logstash-client](https://npm.io/package/logstash-client.md) — 4.5K weekly downloads
- [@nocobase/plugin-logger](https://npm.io/package/@nocobase/plugin-logger.md) — 2.0K weekly downloads
- [child-process-debug](https://npm.io/package/child-process-debug.md) — 695 weekly downloads

## Recent versions

- 1.2.1 (latest) — 2018-01-04
- 1.2.0 — 2018-01-04
- 1.1.0 — 2018-01-04
- 1.0.3 — 2017-12-17
- 1.0.2 — 2017-09-12
- 1.0.1 — 2017-07-12
- 1.0.0 — 2017-07-12

## README

Fork of https://github.com/chakrit/bunyan-raven ported to typescript and stuff.

# BUNYAN-RAVEN

BUNYAN-RAVEN is an `objectMode` [`stream.Writable`][1] implementation that expects
[node-bunyan][0] log records and sends them to an instance of [raven-node][2].

Basically, this module lets you integrate your existing [node-bunyan][0] logs with
[getsentry.com][3] nice and easy without having to rewrite any code except for where you
initialize your [node-bunyan][0] logger.

# USAGE

First, create your [raven-node][2] client as usual:

```js
const raven = require('raven');
const client = new raven.Client("___YOUR_SENTRY_DSN__OR_DEFER_TO_env.SENTRY_DSN___");

client.patchGlobal(); // optional
```

Then when you create your [node-bunyan][0] logger, include an instance of the
`RavenStream` as well and configure it to match your desired logging level:

```js
const bunyan = require('bunyan');
const { RavenStream } = require('bunyan-raven');

const logger = bunyan.createLogger({
    name: 'test logger',
  // IMPORTANT PART:
    streams: [
        {
            type: 'raw',
            stream: new RavenStream(client),,
            level: 'error'
        }
    ]
});
```

`RavenStream` will automatically logs any error objects if it is passed in the `err` key
of the log record or will simply creates a new Error object with the log record's message.

# SUPPORT / CONTRIBUTE

PRs welcome. Bug reports/assistance, just [file a GitHub issue][4].

# LICENSE

BSD-2-clause


[0]: https://github.com/trentm/node-bunyan
[1]: http://nodejs.org/api/stream.html#stream_class_stream_writable
[2]: https://github.com/mattrobenolt/raven-node
[3]: https://getsentry.com/
[4]: https://github.com/mixer/bunyan-raven/issues

---
_Source: https://npm.io/package/@mcph/bunyan-raven · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
