# @jitesoft/yolog-sentry-plugin

> Plugin for @jitesoft/yolog to output errors and messages to sentry.

Latest version **1.4.0** (published 2021-04-05) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install @jitesoft/yolog-sentry-plugin
pnpm add @jitesoft/yolog-sentry-plugin
yarn add @jitesoft/yolog-sentry-plugin
bun add @jitesoft/yolog-sentry-plugin
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 1.4.0 |
| Published | 2021-04-05 |
| First published | 2019-10-24 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 59.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Johannes Tegnér |
| Maintainers | jitesoft~, johannestegner |
| Keywords | logging, yolog, plugin, jitesoft, async, node-yolog, node, sentry, browser, web |

## Links

- npm: https://www.npmjs.com/package/@jitesoft/yolog-sentry-plugin
- Repository: https://gitlab.com/jitesoft/open-source/javascript/yolog-plugins/sentry
- Homepage: https://gitlab.com/jitesoft/open-source/javascript/yolog-plugins/sentry#readme
- Issues: https://gitlab.com/jitesoft/open-source/javascript/yolog-plugins/sentry/issues
- npm.io page: https://npm.io/package/@jitesoft/yolog-sentry-plugin

## Dependencies (1)

- [@sentry/minimal](https://npm.io/package/@sentry/minimal.md) ^6.2.5

## Alternatives

- [@opentelemetry/exporter-zipkin](https://npm.io/package/@opentelemetry/exporter-zipkin.md) — 14.8M weekly downloads
- [pusher-js](https://npm.io/package/pusher-js.md) — 2.0M weekly downloads
- [browserify](https://npm.io/package/browserify.md) — 1.7M weekly downloads
- [sqs-consumer](https://npm.io/package/sqs-consumer.md) — 1.7M weekly downloads
- [@sanity/eventsource](https://npm.io/package/@sanity/eventsource.md) — 930.8K weekly downloads

## Recent versions

- 1.4.0 (latest) — 2021-04-05
- 1.3.4 — 2021-01-08
- 1.3.3 — 2020-11-02
- 1.3.2 — 2020-10-11
- 1.3.1 — 2020-09-25
- 1.3.0 — 2020-07-11
- 1.1.2 — 2020-03-23
- 1.1.1 — 2020-01-15
- 1.1.0 — 2019-12-13
- 1.0.3 — 2019-11-29
- 1.0.2 — 2019-11-06
- 1.0.1 — 2019-11-04
- 1.0.0 — 2019-10-24

## README

# Yolog Sentry plugin

[![npm (scoped)](https://img.shields.io/npm/v/@jitesoft/yolog-sentry-plugin)](https://www.npmjs.com/package/@jitesoft/yolog-sentry-plugin)
[![Known Vulnerabilities](https://snyk.io/test/npm/@jitesoft/yolog-sentry-plugin/badge.svg)](https://snyk.io/test/npm/@jitesoft/yolog-sentry-plugin)
[![pipeline status](https://gitlab.com/jitesoft/open-source/javascript/yolog-plugins/sentry/badges/master/pipeline.svg)](https://gitlab.com/jitesoft/open-source/javascript/yolog-plugins/sentry/commits/master)
[![coverage report](https://gitlab.com/jitesoft/open-source/javascript/yolog-plugins/sentry/badges/master/coverage.svg)](https://gitlab.com/jitesoft/open-source/javascript/yolog-plugins/sentry/commits/master)
[![npm](https://img.shields.io/npm/dt/@jitesoft/yolog-sentry-plugin)](https://www.npmjs.com/package/@jitesoft/yolog-sentry-plugin)
[![Back project](https://img.shields.io/badge/Open%20Collective-Tip%20the%20devs!-blue.svg)](https://opencollective.com/jitesoft-open-source)


Plugin for the [`@jitesoft/yolog`](https://www.npmjs.com/package/@jitesoft/yolog) logger to post logs and errors to Sentry.

## Usage:

Install with your favorite package manager!

```bash
npm i @jitesoft/yolog-sentry-plugin --save
yarn add @jitesoft/yolog-sentry-plugin
```

The plugin uses the `@sentry/minimal` package to make sure that it works on both browser and node alike.
You have to install the sentry plugin required for your current environment (`@sentry/node`, `@sentry/browser`) 
and set it up as you wish.  
When that is done, the `yolog-sentry-plugin` will be able to send its logs and errors to sentry.

```js
import logger from '@jitesoft/yolog';
import SentryPlugin from '@jitesoft/yolog-sentry-plugin';
import * as Sentry from '@sentry/node (or browser)';

Sentry.init({
  dsn: 'some-dsn-to-connect-to-sentry'
});

logger.addPlugin(new SentryPlugin());
logger.alert('Oh no!');
```

It is possible to add `tags`, `extras` and `user` to the data sent to sentry, the way to do this is to
add a `provider` to the plugin statically.  
The providers are callback functions which will be used to fetch the data required. The `tags` and `extras` providers
should return objects with standard key-value pairs while the `userProvider` should return a user object. For more documentation on what values are expected and/or 
what will happen to them, refer to the Sentry [documentation](https://docs.sentry.io/platforms/javascript/#adding-context).

Currently, the `fingerprint` is the full message that is passed through the logger.

---
_Source: https://npm.io/package/@jitesoft/yolog-sentry-plugin · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
