Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(node): Add support for winston logger #15983

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from

Conversation

AbhiPrasad
Copy link
Member

@AbhiPrasad AbhiPrasad commented Apr 4, 2025

resolves https://linear.app/getsentry/issue/JS-4

resolves #15953

This PR adds support for winston, a popular logging library for Node.js. Specifically you can send logs via winston to Sentry.

Usage:

const winston = require('winston');
const Transport = require('winston-transport');

const transport = Sentry.createSentryWinstonTransport(Transport);

const logger = winston.createLogger({
  transports: [transport],
});

createSentryWinstonTransport was used because we didn't want to add winston as a dependency to the nodejs sdk.

image

@AbhiPrasad AbhiPrasad self-assigned this Apr 4, 2025
@AbhiPrasad AbhiPrasad force-pushed the abhi-winston-support branch 2 times, most recently from 0f8d1d9 to 1ff5605 Compare April 4, 2025 09:52
Copy link
Contributor

github-actions bot commented Apr 4, 2025

size-limit report 📦

Path Size % Change Change
@sentry/browser 23.28 KB - -
@sentry/browser - with treeshaking flags 23.12 KB - -
@sentry/browser (incl. Tracing) 36.95 KB - -
@sentry/browser (incl. Tracing, Replay) 74.14 KB - -
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 67.51 KB - -
@sentry/browser (incl. Tracing, Replay with Canvas) 78.8 KB - -
@sentry/browser (incl. Tracing, Replay, Feedback) 90.61 KB - -
@sentry/browser (incl. Feedback) 39.68 KB - -
@sentry/browser (incl. sendFeedback) 27.9 KB - -
@sentry/browser (incl. FeedbackAsync) 32.67 KB - -
@sentry/react 25.09 KB - -
@sentry/react (incl. Tracing) 38.87 KB - -
@sentry/vue 27.51 KB - -
@sentry/vue (incl. Tracing) 38.67 KB - -
@sentry/svelte 23.32 KB - -
CDN Bundle 24.51 KB - -
CDN Bundle (incl. Tracing) 36.95 KB - -
CDN Bundle (incl. Tracing, Replay) 71.99 KB - -
CDN Bundle (incl. Tracing, Replay, Feedback) 77.16 KB - -
CDN Bundle - uncompressed 71.47 KB - -
CDN Bundle (incl. Tracing) - uncompressed 109.23 KB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 220.52 KB - -
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 233.05 KB - -
@sentry/nextjs (client) 40.49 KB - -
@sentry/sveltekit (client) 37.39 KB - -
@sentry/node 143.09 KB - -
@sentry/node - without tracing 96.29 KB -0.01% -1 B 🔽
@sentry/aws-serverless 120.64 KB - -

View base workflow run

@AbhiPrasad AbhiPrasad force-pushed the abhi-winston-support branch from 1ff5605 to 7ba9a19 Compare April 9, 2025 12:41
@AbhiPrasad AbhiPrasad marked this pull request as ready for review April 9, 2025 12:41
@AbhiPrasad AbhiPrasad requested review from a team, stephanie-anderson, chargome, lforst and mydea and removed request for a team April 9, 2025 12:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add winstonIntegration
1 participant