From b5f27821110c7ae42a5a23ce56e938cb8a8213fc Mon Sep 17 00:00:00 2001 From: Abhijeet Prasad Date: Tue, 29 Jul 2025 11:43:58 -0400 Subject: [PATCH] feat(sdk): enable logs in docs --- src/instrumentation-client.ts | 4 ++++ src/instrumentation.ts | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/src/instrumentation-client.ts b/src/instrumentation-client.ts index 874897ca9fbc35..604944f60be981 100644 --- a/src/instrumentation-client.ts +++ b/src/instrumentation-client.ts @@ -7,6 +7,9 @@ Sentry.init({ // Adjust this value in production, or use tracesSampler for greater control tracesSampleRate: 1, + // Enable logs to be sent to Sentry + enableLogs: true, + // Setting this option to true will print useful information to the console while you're setting up Sentry. debug: false, @@ -30,6 +33,7 @@ Sentry.init({ Sentry.browserTracingIntegration({ linkPreviousTrace: 'session-storage', }), + Sentry.consoleLoggingIntegration(), ], }); diff --git a/src/instrumentation.ts b/src/instrumentation.ts index c8b1d956de1e0f..0605bfda1ff5c3 100644 --- a/src/instrumentation.ts +++ b/src/instrumentation.ts @@ -5,9 +5,11 @@ export function register() { Sentry.init({ dsn: process.env.SENTRY_DSN, tracesSampleRate: 1, + enableLogs: true, debug: false, environment: process.env.NODE_ENV === 'development' ? 'development' : undefined, spotlight: process.env.NODE_ENV === 'development', + integrations: [Sentry.consoleLoggingIntegration()], }); } @@ -15,8 +17,10 @@ export function register() { Sentry.init({ dsn: process.env.SENTRY_DSN, tracesSampleRate: 1, + enableLogs: true, debug: false, environment: process.env.NODE_ENV === 'development' ? 'development' : undefined, + integrations: [Sentry.consoleLoggingIntegration()], // temporary change for investigating edge middleware tx names beforeSendTransaction(event) { if (