![require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages](https://cdn.sanity.io/images/cgdhsj6q/production/be8ab80c8efa5907bc341c6fefe9aa20d239d890-1600x1097.png?w=400&fit=max&auto=format)
Security News
require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
winston-sentry-javascript-node
Advanced tools
Sentry transport for the winson logger that using official Sentry SDK for javascript instead of the old Raven.
Sentry transport for the winson logger 3+ and uses the @sentry/node SDK instead of the old Raven.
This package is written in Typescript with the well typing and code quality.
npm install winston-sentry-javascript-node --save
import { SentryTransport } from 'winston-sentry-javascript-node';
const logger = winston.createLogger({
transports: [
new SentryTransport({
sentry{
dsn: 'MY_SENTRY_DSN',
},
}),
],
});
logger.error('Plain text error.');
logger.error(new Error('Something went wrong.'));
Set user information, as well as tags and further extras.
logger.error('Plain text error.', {
tags: {
foo: 'bar',
},
user: {
ip: '127.0.0.1',
username: 'user1',
},
extra: {
extra1: 'extra1',
extra2: 'extra2',
},
});
Catch and send uncaughtException
to the Sentry.
const logger = winston.createLogger({
transports: [
new SentryTransport({
sentry{
dsn: 'MY_SENTRY_DSN',
},
handleExceptions: true,
}),
],
});
// or
const logger = winston.createLogger({
exceptionHandlers: [
new SentryTransport({
sentry: {
dsn: 'MY_SENTRY_DSN',
}
}),
]
});
new SentryTransport(opts)
interface TransportStreamOptions {
format?: logform.Format;
level?: string;
silent?: boolean;
handleExceptions?: boolean;
log?(info: any, next: () => void): any;
logv?(info: any, next: () => void): any;
close?(): void;
}
By default, if you provide an Error Object to logger, this package will set the following extra:
{
stack: err.stack,
message: err.message,
}
© Ben Hu (benjamin658), 2019-NOW
Released under the MIT License
FAQs
Sentry transport for the winson logger that using official Sentry SDK for javascript instead of the old Raven.
The npm package winston-sentry-javascript-node receives a total of 8 weekly downloads. As such, winston-sentry-javascript-node popularity was classified as not popular.
We found that winston-sentry-javascript-node demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
Security News
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.