Registry / devops / bristol-sentry

bristol-sentry

JSON →
library0.0.5jsnpmunverified

A transport and formatter for the Bristol logging library that sends log events to Sentry (error tracking). Version 0.0.5 is the latest release, limited compatibility with Node >=5.0.0. It wraps the raven Node client, converting Bristol log calls into Sentry events: Error objects trigger captureException, others trigger captureMessage. Requires manual setup with a raven Client and Bristol instance. Not actively maintained (last commit in 2016), no TypeScript definitions.

npm install bristol-sentry
INSTALL
IMPORT
SIG · BRISTOL-SENTRY
B
bristol-sentry
devopsjavascriptv0.0.5
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default (bristolSentry)
const bristolSentry = require('bristol-sentry');
import bristolSentry from 'bristol-sentry';
CJS-only package; ESM import will fail. Use require.
formatter
const bristolSentry = require('bristol-sentry'); const formatter = bristolSentry.formatter;
const { formatter } = require('bristol-sentry');
formatter is a property on the default export, not a named export.
raven Client
const raven = require('raven'); const client = new raven.Client('dsn');
raven must be installed separately. Client must be instantiated with a DSN.

Shows how to configure bristol-sentry with a raven client and send log events.

const bristol = require('bristol'); const raven = require('raven'); const bristolSentry = require('bristol-sentry'); const client = new raven.Client('https://public:private@sentry.example.com/1'); const target = bristolSentry({ client }); bristol.addTarget(target).withFormatter(bristolSentry.formatter); bristol.info('Hello Sentry'); bristol.error(new Error('Something broke'));
Debug
Known issues
gotchaError objects trigger captureException without the message text; message is prepended to extra.
fix
Include descriptive message in the Error object itself, or handle extra manually.
affects: >=0.0.0
deprecatedPackage uses the deprecated `raven` library. Sentry now recommends `@sentry/node`.
fix
Migrate to @sentry/node and consider alternative logging integrations.
affects: >=0.0.0
gotchaOnly works with the `bristol` logger; not compatible with other loggers.
fix
Use Bristol as the primary logger, or switch to another Sentry transport.
affects: >=0.0.0
gotchaNo TypeScript definitions; may cause type errors in TS projects.
fix
Create a custom declaration file or use @ts-ignore.
affects: >=0.0.0
Errors
Common errors & fixes
Error: Cannot find module 'bristol-sentry'
Missing dependency or incorrect install.
fix
Run: npm install bristol-sentry
TypeError: bristolSentry is not a function
Default import used incorrectly in ES module context.
fix
Use require('bristol-sentry') instead of import.
Error: raven Client is required
Missing or invalid raven client passed to bristolSentry.
fix
Pass an instance: bristolSentry({ client: new raven.Client(dsn) })
Upgrade
Version history
0.0.5latest on npm
Audit
Dependencies
ravenrequiredSentry Node.js client required for event sending
bristolrequiredLogging framework this package extends
Agent activity
4 hits · last 30 days
node
4
Resources
bristol-sentry — npm install bristol-sentry · libregistry