@schablone/logging-transport-sentry-browser
TypeScript icon, indicating that this package has built-in type declarations

1.2.0 • Public • Published

logging-transport-sentry-browser

This is the browser implementation of the SentryTransport. Use this if you want to log Sentry from a browser.

Usage

import LoggerFactory from '@schablone/logging';
import { SentryBrowserTransport } from '@schablone/logging-transport-sentry-browser';

const logger = LoggerFactory({
  transports: [
    new SentryBrowserTransport({
      sentryConfig: {
        dsn: 'a-sentry-server-dsn',
        initialScope: {
          user: { id: '12345', email: 'bob@test.de', username: 'BobTester' },
        },
      },
      transportLogOptions: {
        meta: {
          information: 'Something to note'
        },
        tags: ['SentryTag'],
      },
    }),
  ],
  globalLogOptions: {
    callback: (data) => {
      const { error, level, message, meta, objects } = data;
      // Use data in some way
    },
    meta: {
      name: 'Bob',
      job: 'Tester',
    },
    tags: ['GlobalTag'],
  },
});
logger.debug("This is a debug message");

Readme

Keywords

none

Package Sidebar

Install

npm i @schablone/logging-transport-sentry-browser

Weekly Downloads

3

Version

1.2.0

License

none

Unpacked Size

4.63 kB

Total Files

8

Last publish

Collaborators

  • technicalalchemist
  • alchemistgordon
  • floriande
  • gerby