This package has been deprecated

Author message:

Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

@jitesoft/yolog-sentry-plugin

1.4.0 • Public • Published

Yolog Sentry plugin

npm (scoped) Known Vulnerabilities pipeline status coverage report npm Back project

Plugin for the @jitesoft/yolog logger to post logs and errors to Sentry.

Usage:

Install with your favorite package manager!

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.

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.

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

Package Sidebar

Install

npm i @jitesoft/yolog-sentry-plugin

Weekly Downloads

4

Version

1.4.0

License

MIT

Unpacked Size

61.4 kB

Total Files

4

Last publish

Collaborators

  • jitesoft~
  • johannestegner