frontendLogger
Logging library for SPA and SSR
Getting Started
Install npm package
yarn
yarn add --dev @bananakun/sentry-frontend-logger
npm
npm install -save @bananakun/sentry-frontend-logger
How To Use
please set configuration values for sentry.
https://docs.sentry.io/learn/cli/configuration/
TypeScript
import { SentryLogger, IOptional } from 'sentry-frontend-logger';
const sendError = (e: Error): void => {
const optional: IOptional = {
traceId: <TRACE ID>,
serviceName: <SERVICE NAME>,
environment: <ENVIRONMENT>,
};
const instance = new SentryLogger(<SENTRY DSN>, optional);
instance.error(e);
};
You set <TRACE ID>
, will be trace error with tags on sentry.
The errors are divided name of <ENVIRONMENT>-<SERVICE NAME>
on sentry
License
MIT