Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@bananakun/sentry-frontend-logger

akgw1MIT1.0.7TypeScript support: included

Logging frontend for Sentry

logger

readme

frontendLogger

npm version Build Status Coverage Status MIT License

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