Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@leagueutil/sentry-error-logger

Package Overview
Dependencies
Maintainers
0
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@leagueutil/sentry-error-logger

Setup a project to initialize and use Sentry to send error events within a cloud node function - minor trigger

  • 1.0.5
  • latest
  • npm
  • Socket score

Version published
Maintainers
0
Created
Source

Node package to initialize Sentry and send error events with user and environment breadcrumbs.

  • This package is designed to Initialize Sentry and send an error event to Sentry that contains all the expected user and environment breadcrumbs
  • To Send an error event to Sentry the caller has two options:
    • logExceptionWithConfig - takes a configuration object and uses it to build Sentry attributes for the event.
    • logExceptionWithSentryData - takes custom prebuilt Sentry attributes { sentryDsn, sentryEnv, fingerPrint, tags } and uses for the event. See the definition of logExceptionWithConfig and logExceptionWithSentryData for more details.

/**

  • logExceptionWithConfig captures an error/exception and forwards it to Sentry as an event.
  • This function takes a configuration object and uses it to build Sentry attributes
  • See the implementation of buildLogData for more context.
  • Note: if you need the flexibility of using custom tags and fingerprint generated based your own custom rules, use logExceptionWithSentryData
  • @param exception - The error object to be logged.
  • @param severity - log level or severity level of the failure e.g "fatal", "error"
  • @param userId - A unique user Id, identifying the user who made the failed request.
  • @param configuration - The configuration object required to build customs Sentry tags and fingerprint.
  • @returns {Promise} */ async function logExceptionWithConfig( exception, severity, userId, configuration ) * Example: const sentry = require("@everlong/sentry-error-logging"); const configuration = { tenantId:"tenant", env: "dev", sentryDsn:"https://dsn.string" }; try{ // doSomething(); }catch(err){ await sentry.logExceptionWithConfig(err, "fatal", userId, configuration); }

FAQs

Package last updated on 03 Dec 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc