@schablone/logging-transport-sentry-browser
v1.2.0
Published
This is the browser implementation of the SentryTransport. Use this if you want to log Sentry from a browser.
Downloads
21
Keywords
Readme
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: '[email protected]', 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");