From 1fa2387555e7d6481ba3e1316f9dc61ac0c2fa84 Mon Sep 17 00:00:00 2001 From: Nicolas Hrubec Date: Thu, 20 Aug 2026 15:57:13 +0200 Subject: [PATCH] docs(js): make logs enabled by default, drop required enableLogs flag JavaScript SDK logs will be on by default from v10.71.0, so users no longer need to set enableLogs: true. Remove the flag from JS setup snippets, onboarding config blocks, and integration docs, and drop the now no-op "logs" onboarding toggle from JS pages (kept for Effect, whose block still wires up SentryEffectLogger). Dedicated logs-setup and logging-integration pages gain a version alert noting that on SDK versions below 10.71.0 enableLogs: true is still required. The enableLogs option default is updated to true. Note: 10.71.0 is a placeholder pending the final default-on version. Co-Authored-By: Claude Opus 4.8 (1M context) --- .../common/best-practices/sentry-testkit.mdx | 2 +- .../configuration/integrations/pino.mdx | 10 +-- .../common/configuration/options.mdx | 44 +++++++------ docs/platforms/javascript/common/index.mdx | 5 +- .../javascript/common/logs/index.mdx | 63 ++++++++++++++++--- .../guides/angular/manual-setup.mdx | 11 ---- .../javascript/guides/astro/index.mdx | 1 - .../guides/azure-functions/index.mdx | 7 +-- .../platforms/javascript/guides/bun/index.mdx | 9 +-- .../javascript/guides/capacitor/index.mdx | 1 - .../guides/cloudflare/frameworks/astro.mdx | 1 - .../frameworks/hydrogen-react-router.mdx | 14 ----- .../guides/cloudflare/frameworks/remix.mdx | 1 - .../cloudflare/frameworks/tanstack-start.mdx | 11 ---- .../javascript/guides/cloudflare/index.mdx | 14 +---- .../javascript/guides/deno/index.mdx | 9 +-- .../javascript/guides/effect/index.mdx | 20 ------ .../javascript/guides/electron/index.mdx | 18 +----- .../javascript/guides/elysia/index.mdx | 14 +---- .../javascript/guides/ember/index.mdx | 6 -- .../javascript/guides/firebase/index.mdx | 6 +- .../javascript/guides/gatsby/index.mdx | 6 -- .../javascript/guides/gcp-functions/index.mdx | 2 +- .../javascript/guides/hono/index.mdx | 22 +------ .../javascript/guides/nestjs/index.mdx | 2 +- .../javascript/guides/nextjs/index.mdx | 10 --- .../javascript/guides/nextjs/logs/index.mdx | 21 +++---- .../guides/nextjs/manual-setup/index.mdx | 18 +----- .../nextjs/manual-setup/pages-router.mdx | 18 +----- .../javascript/guides/nitro/index.mdx | 9 +-- .../javascript/guides/react-router/index.mdx | 11 ---- .../guides/react-router/manual-setup.mdx | 11 ---- .../javascript/guides/react/index.mdx | 6 -- .../javascript/guides/remix/manual-setup.mdx | 1 - .../javascript/guides/solid/index.mdx | 6 -- .../javascript/guides/solidstart/index.mdx | 11 ---- .../javascript/guides/svelte/index.mdx | 11 ---- .../sveltekit/manual-setup__v10.7.0.mdx | 11 ---- .../guides/tanstackstart-react/index.mdx | 1 - .../manual-setup/index.mdx | 11 ---- .../platforms/javascript/guides/vue/index.mdx | 11 ---- .../javascript/guides/wasm/index.mdx | 9 +-- .../integration-filter-example/javascript.mdx | 1 - .../logs/javascript-consola-integration.mdx | 7 ++- ...javascript-console-logging-integration.mdx | 6 +- includes/logs/javascript-pino-integration.mdx | 6 +- .../logs/javascript-winston-integration.mdx | 7 ++- .../console-logs-vs-breadcrumbs/_default.mdx | 3 +- .../javascript.astro.mdx | 14 ----- .../getting-started-complete/javascript.mdx | 1 - .../javascript.nuxt.mdx | 11 ---- .../javascript.remix.mdx | 15 ----- .../javascript.sveltekit.mdx | 16 ----- .../javascript.capacitor.mdx | 23 ------- .../javascript.cloudflare.hono.mdx | 5 -- .../javascript.cloudflare.workers.mdx | 5 -- .../javascript.hono.mdx | 10 --- .../getting-started-config/javascript.mdx | 15 ----- .../javascript.nestjs.mdx | 5 -- .../javascript.node.mdx | 10 --- .../getting-started-node/javascript.mdx | 2 +- platform-includes/logs/options/javascript.mdx | 1 - .../logs/requirements/javascript.mdx | 7 ++- .../logs/setup/javascript.cloudflare.mdx | 4 +- .../logs/setup/javascript.electron.mdx | 6 +- platform-includes/logs/setup/javascript.mdx | 4 +- .../logs/setup/javascript.nextjs.mdx | 5 +- 67 files changed, 144 insertions(+), 520 deletions(-) diff --git a/docs/platforms/javascript/common/best-practices/sentry-testkit.mdx b/docs/platforms/javascript/common/best-practices/sentry-testkit.mdx index 4d1a28fe702bbe..0e2fae6738c91f 100644 --- a/docs/platforms/javascript/common/best-practices/sentry-testkit.mdx +++ b/docs/platforms/javascript/common/best-practices/sentry-testkit.mdx @@ -78,7 +78,7 @@ Beyond errors and performance transactions, the testkit captures a range of Sent - **Errors** — `testkit.reports()` returns all captured error reports. Each report also exposes any evaluated feature flags via `report.flags`. - **Transactions** — `testkit.transactions()` returns all captured performance transactions. -- **Structured logs** — `testkit.logs()` returns captured logs (requires `enableLogs: true` in your Sentry configuration). +- **Structured logs** — `testkit.logs()` returns captured logs (on SDK versions below `10.71.0`, requires `enableLogs: true` in your Sentry configuration). - **User feedback** — `testkit.feedback()` returns submitted user feedback. - **Cron check-ins** — `testkit.checkIns()` returns cron monitor check-ins with their status. diff --git a/docs/platforms/javascript/common/configuration/integrations/pino.mdx b/docs/platforms/javascript/common/configuration/integrations/pino.mdx index 31398d88bcb4cb..523b37c5d018c6 100644 --- a/docs/platforms/javascript/common/configuration/integrations/pino.mdx +++ b/docs/platforms/javascript/common/configuration/integrations/pino.mdx @@ -36,9 +36,13 @@ _Import name: `Sentry.pinoIntegration`_ The `pinoIntegration` adds instrumentation for the `pino` library so that calls to the pino logger are captured as logs. Optionally, you can capture calls to the pino logger as errors. + + On SDK versions below `10.71.0`, you must also set `enableLogs: true` in your + `Sentry.init` to send logs. + + ```JavaScript Sentry.init({ - enableLogs: true, integrations: [Sentry.pinoIntegration()], }); ``` @@ -72,7 +76,7 @@ Configure how pino logs are captured as Sentry logs. - Type: `Array<'trace' | 'debug' | 'info' | 'warn' | 'error' | 'fatal'>` - Default: `["trace", "debug", "info", "warn", "error", "fatal"]` -Levels that trigger capturing of logs. Logs are only captured if `enableLogs` is enabled in your Sentry configuration. +Levels that trigger capturing of logs. ## Supported Versions @@ -84,7 +88,6 @@ Levels that trigger capturing of logs. Logs are only captured if `enableLogs` is ```js Sentry.init({ - enableLogs: true, integrations: [ Sentry.pinoIntegration({ log: { levels: ["info", "warn", "error"] } }), ], @@ -95,7 +98,6 @@ Sentry.init({ ```js Sentry.init({ - enableLogs: true, integrations: [ Sentry.pinoIntegration({ error: { levels: ["warn", "error"] } }), ], diff --git a/docs/platforms/javascript/common/configuration/options.mdx b/docs/platforms/javascript/common/configuration/options.mdx index fa4c36aa39b4d6..2b5bf50b6145cc 100644 --- a/docs/platforms/javascript/common/configuration/options.mdx +++ b/docs/platforms/javascript/common/configuration/options.mdx @@ -132,6 +132,7 @@ Sentry.init({ ``` Data you set explicitly (for example, via `Sentry.setUser()`) is always sent, regardless of `dataCollection`. + @@ -139,20 +140,20 @@ Data you set explicitly (for example, via `Sen Controls which categories of data the SDK collects automatically. All fields are optional. - By default the SDK collects rich debugging context (including user identity, request/response bodies, and generative AI content) and scrubs values whose keys match the built-in sensitive denylist (`auth`, `token`, `password`, and similar). +By default the SDK collects rich debugging context (including user identity, request/response bodies, and generative AI content) and scrubs values whose keys match the built-in sensitive denylist (`auth`, `token`, `password`, and similar). For more on what data Sentry collects and how to control it, see Data Management. -| Key | Type | Default | Description | -| --------------------- | ---------------------------- | ---------- | ---------------------------------------------------------------------------------------------------------------------------------------- | -| `userInfo` | `boolean` | `true` | Populate `user.*` fields (`id`, `email`, `username`, `ip_address`) from instrumentation. | -| `cookies` | `CollectBehavior` | `true` | Collect cookies. | -| `httpHeaders` | `{ request?, response? }` | both `true`| Collect HTTP request and response headers. | -| `httpBodies` | `HttpBodyCollectionTarget[]` | all types | Body types to collect: `"incomingRequest"`, `"outgoingRequest"`, `"incomingResponse"`, `"outgoingResponse"`. Set to `[]` to disable. | -| `urlQueryParams` | `CollectBehavior` | `true` | Collect URL query parameters. | -| `genAI` | `{ inputs?, outputs? }` | both `true`| Collect generative AI input/output content. Metadata is always collected. | -| `stackFrameVariables` | `boolean` | `true` | Capture local variable values in stack frames. | -| `frameContextLines` | `number` | `5` | Source code lines captured around each stack frame. | +| Key | Type | Default | Description | +| --------------------- | ---------------------------- | ----------- | ------------------------------------------------------------------------------------------------------------------------------------ | +| `userInfo` | `boolean` | `true` | Populate `user.*` fields (`id`, `email`, `username`, `ip_address`) from instrumentation. | +| `cookies` | `CollectBehavior` | `true` | Collect cookies. | +| `httpHeaders` | `{ request?, response? }` | both `true` | Collect HTTP request and response headers. | +| `httpBodies` | `HttpBodyCollectionTarget[]` | all types | Body types to collect: `"incomingRequest"`, `"outgoingRequest"`, `"incomingResponse"`, `"outgoingResponse"`. Set to `[]` to disable. | +| `urlQueryParams` | `CollectBehavior` | `true` | Collect URL query parameters. | +| `genAI` | `{ inputs?, outputs? }` | both `true` | Collect generative AI input/output content. Metadata is always collected. | +| `stackFrameVariables` | `boolean` | `true` | Capture local variable values in stack frames. | +| `frameContextLines` | `number` | `5` | Source code lines captured around each stack frame. | The `cookies`, `httpHeaders`, and `urlQueryParams` categories accept a `CollectBehavior` value: @@ -752,9 +753,14 @@ Instead, enable stream mode - + + +Controls whether the `logger` APIs send logs to Sentry. Logs are captured by default. Set this option to `false` to disable log capturing. -Set this option to `true` to enable log capturing in Sentry. Only when this is enabled will the `logger` APIs actually send logs to Sentry. + + In SDK versions below `10.71.0`, this option defaults to `false`. On those + versions, you must set `enableLogs: true` to send logs to Sentry. + @@ -767,8 +773,8 @@ This function is called with a log object, and can return a modified log object, ## Metrics Options - **Note:** For Electron, metric options apply to the process where these options - are set. + **Note:** For Electron, metric options apply to the process where these + options are set. @@ -809,8 +815,8 @@ The sample rate for replays that are recorded when an error happens. This type o -A number between `0` and `1` that sets the percentage of how many sessions should have profiling enabled. `1.0` enables profiling in every session, `0.5` enables profiling for 50% of the sessions, and `0` enables it for none. -The sampling decision is made once at the beginning of a session. +A number between `0` and `1` that sets the percentage of how many sessions should have profiling enabled. `1.0` enables profiling in every session, `0.5` enables profiling for 50% of the sessions, and `0` enables it for none. +The sampling decision is made once at the beginning of a session. This option is required to enable profiling (default is `0`). @@ -838,8 +844,8 @@ A number between `0` and `1`, controlling the percentage chance a given sampled -A number between `0` and `1` that sets the percentage of how many sessions should have profiling enabled. `1.0` enables profiling in every session, `0.5` enables profiling for 50% of the sessions, and `0` enables it for none. -The sampling decision is made once at the beginning of a session. +A number between `0` and `1` that sets the percentage of how many sessions should have profiling enabled. `1.0` enables profiling in every session, `0.5` enables profiling for 50% of the sessions, and `0` enables it for none. +The sampling decision is made once at the beginning of a session. This option is required to enable profiling (default is `0`). diff --git a/docs/platforms/javascript/common/index.mdx b/docs/platforms/javascript/common/index.mdx index 75d560e96eca8f..40a8817e561a83 100644 --- a/docs/platforms/javascript/common/index.mdx +++ b/docs/platforms/javascript/common/index.mdx @@ -56,7 +56,6 @@ Select which Sentry features you'd like to install in addition to Error Monitori "performance", "session-replay", "user-feedback", - "logs", ]} /> @@ -73,7 +72,7 @@ Select which Sentry features you'd like to install in addition to Error Monitori @@ -82,7 +81,7 @@ In addition to capturing errors, you can monitor interactions between multiple s Select which Sentry features you'd like to install in addition to Error Monitoring to get the corresponding installation and configuration instructions below. - + diff --git a/docs/platforms/javascript/common/logs/index.mdx b/docs/platforms/javascript/common/logs/index.mdx index 03dd15f0d11f82..47df306d787dc8 100644 --- a/docs/platforms/javascript/common/logs/index.mdx +++ b/docs/platforms/javascript/common/logs/index.mdx @@ -10,7 +10,7 @@ notSupported: -Stack traces tell you *what* broke. Logs tell you *why*. When an error fires, you get a snapshot of the failure, but the context leading up to it is often missing. Logs capture the journey — what the data looked like, which code paths executed, and what state the system was in. +Stack traces tell you _what_ broke. Logs tell you _why_. When an error fires, you get a snapshot of the failure, but the context leading up to it is often missing. Logs capture the journey — what the data looked like, which code paths executed, and what state the system was in. Sentry Logs are **high-cardinality** — you can pass any attributes you want and search or filter by them later. No need to decide upfront which fields are important. Just log what might be useful and query it when you need it. @@ -23,7 +23,7 @@ Sentry Logs are **high-cardinality** — you can pass any attributes you want an ## Setup -Enable logging by adding `enableLogs: true` to your Sentry configuration. +Logs are enabled by default. Just initialize the SDK and use `Sentry.logger` to send logs. @@ -31,7 +31,6 @@ Enable logging by adding `enableLogs: true` to your Sentry configuration. ```javascript Sentry.init({ dsn: "___PUBLIC_DSN___", - enableLogs: true, }); ``` @@ -184,7 +183,6 @@ The log object includes: `level`, `message`, `timestamp`, and `attributes`. ```javascript Sentry.init({ dsn: "___PUBLIC_DSN___", - enableLogs: true, beforeSendLog: (log) => { // Drop debug logs in production if (log.level === "debug") { @@ -211,7 +209,28 @@ Sentry.init({ Everything in Sentry is linked by trace. When you're viewing a log, you can jump to the parent trace to see the full request context. When you're viewing a trace, you can see all logs emitted during that operation. This connection makes it easy to move between high-level performance data and detailed diagnostic logs. - **[Traces](/product/trace-explorer/)** — Logs emitted during an active span automatically include `sentry.trace.parent_span_id`. Click through from any log to see the full trace, or filter logs by trace ID to see everything that happened during a specific request. -- **[Session Replay](/product/session-replay/)** — Logs include `sentry.replay_id` when a replay is active. Jump from a log entry directly to the replay to see what the user was doing when the log was emitted. +- + **[Session Replay](/product/session-replay/)** — Logs include + `sentry.replay_id` when a replay is active. Jump from a log entry directly + to the replay to see what the user was doing when the log was emitted. + - **[Errors](/product/issues/)** — Logs capture the journey leading up to a failure. When an error occurs, your logs show what data was processed, which code paths executed, and what state the system was in — context that stack traces alone can't provide. ## Best Practices @@ -226,10 +245,34 @@ Everything in Sentry is linked by trace. When you're viewing a log, you can jump Any attributes set via `Sentry.setAttribute()` / `Sentry.setAttributes()` (or directly on a scope) are automatically included on all logs. `Sentry.setAttribute(s)` requires SDK version `10.61.0` or above. See [Attributes](#shared-attributes) above for details. - ## Related Features -- Tracing — Logs are automatically linked to traces, so you can see logs in the context of the request or operation that produced them. -- Session Replay — Logs are automatically linked to replays, letting you jump from a log entry to see what the user was doing. -- Error Monitoring — Use logs to add diagnostic context that helps you understand what led to an error. -- Attributes — Set attributes once and have them automatically included on all your logs. +- Tracing — Logs are automatically + linked to traces, so you can see logs in the context of the request or + operation that produced them. +- + Session Replay — Logs are + automatically linked to replays, letting you jump from a log entry to see + what the user was doing. + +- Error Monitoring — Use logs to add + diagnostic context that helps you understand what led to an error. +- Attributes — + Set attributes once and have them automatically included on all your logs. diff --git a/docs/platforms/javascript/guides/angular/manual-setup.mdx b/docs/platforms/javascript/guides/angular/manual-setup.mdx index e3636e578812a8..422012b0835592 100644 --- a/docs/platforms/javascript/guides/angular/manual-setup.mdx +++ b/docs/platforms/javascript/guides/angular/manual-setup.mdx @@ -87,7 +87,6 @@ Choose the features you want to configure, and this guide will show you how: "performance", "session-replay", "user-feedback", - "logs", ]} /> @@ -164,11 +163,6 @@ Sentry.init({ replaysSessionSampleRate: 0.1, replaysOnErrorSampleRate: 1.0, // ___PRODUCT_OPTION_END___ session-replay - // ___PRODUCT_OPTION_START___ logs - - // Enable logs to be sent to Sentry - enableLogs: true, - // ___PRODUCT_OPTION_END___ logs }); bootstrapApplication(AppComponent, appConfig).catch((err) => @@ -232,11 +226,6 @@ Sentry.init({ replaysSessionSampleRate: 0.1, replaysOnErrorSampleRate: 1.0, // ___PRODUCT_OPTION_END___ session-replay - // ___PRODUCT_OPTION_START___ logs - - // Enable logs to be sent to Sentry - enableLogs: true, - // ___PRODUCT_OPTION_END___ logs }); platformBrowserDynamic() diff --git a/docs/platforms/javascript/guides/astro/index.mdx b/docs/platforms/javascript/guides/astro/index.mdx index cb5dd7d2b3ff93..c33822a3e82197 100644 --- a/docs/platforms/javascript/guides/astro/index.mdx +++ b/docs/platforms/javascript/guides/astro/index.mdx @@ -41,7 +41,6 @@ Choose the features you want to configure, and this guide will show you how: "profiling", "session-replay", "user-feedback", - "logs", ]} /> diff --git a/docs/platforms/javascript/guides/azure-functions/index.mdx b/docs/platforms/javascript/guides/azure-functions/index.mdx index 140b666d002e76..9aceeaef32d897 100644 --- a/docs/platforms/javascript/guides/azure-functions/index.mdx +++ b/docs/platforms/javascript/guides/azure-functions/index.mdx @@ -18,7 +18,7 @@ categories: Choose the features you want to configure, and this guide will show you how: @@ -86,11 +86,6 @@ Sentry.init({ // https://docs.sentry.io/platforms/javascript/configuration/options/#profileSessionSampleRate profileSessionSampleRate: 1.0, // ___PRODUCT_OPTION_END___ profiling - // ___PRODUCT_OPTION_START___ logs - - // Enable logs to be sent to Sentry - enableLogs: true, - // ___PRODUCT_OPTION_END___ logs }); // your function code diff --git a/docs/platforms/javascript/guides/bun/index.mdx b/docs/platforms/javascript/guides/bun/index.mdx index 63610ff3db3779..4933ee05c51ee0 100644 --- a/docs/platforms/javascript/guides/bun/index.mdx +++ b/docs/platforms/javascript/guides/bun/index.mdx @@ -17,9 +17,7 @@ categories: Choose the features you want to configure, and this guide will show you how: - + @@ -78,11 +76,6 @@ Sentry.init({ // https://docs.sentry.io/platforms/javascript/configuration/options/#traces-sample-rate tracesSampleRate: 1.0, // ___PRODUCT_OPTION_END___ performance - // ___PRODUCT_OPTION_START___ logs - - // Enable logs to be sent to Sentry - enableLogs: true, - // ___PRODUCT_OPTION_END___ logs }); ``` diff --git a/docs/platforms/javascript/guides/capacitor/index.mdx b/docs/platforms/javascript/guides/capacitor/index.mdx index e7fa8c2588ce51..9471d642c31adc 100644 --- a/docs/platforms/javascript/guides/capacitor/index.mdx +++ b/docs/platforms/javascript/guides/capacitor/index.mdx @@ -67,7 +67,6 @@ Choose the features you want to configure, and this guide will show you how: "performance", "session-replay", "user-feedback", - "logs", ]} /> diff --git a/docs/platforms/javascript/guides/cloudflare/frameworks/astro.mdx b/docs/platforms/javascript/guides/cloudflare/frameworks/astro.mdx index 86aa59d6440e10..fdb8fb05d76870 100644 --- a/docs/platforms/javascript/guides/cloudflare/frameworks/astro.mdx +++ b/docs/platforms/javascript/guides/cloudflare/frameworks/astro.mdx @@ -135,7 +135,6 @@ export const onRequest = [ "performance", "session-replay", "user-feedback", - "logs", ]} /> diff --git a/docs/platforms/javascript/guides/cloudflare/frameworks/hydrogen-react-router.mdx b/docs/platforms/javascript/guides/cloudflare/frameworks/hydrogen-react-router.mdx index 563b5b394bda79..6841468456563d 100644 --- a/docs/platforms/javascript/guides/cloudflare/frameworks/hydrogen-react-router.mdx +++ b/docs/platforms/javascript/guides/cloudflare/frameworks/hydrogen-react-router.mdx @@ -28,7 +28,6 @@ Choose the features you want to configure, and this guide will show you how: "performance", "session-replay", "user-feedback", - "logs", ]} /> @@ -111,11 +110,6 @@ Sentry.init({ }), // ___PRODUCT_OPTION_END___ user-feedback ], - // ___PRODUCT_OPTION_START___ logs - - // Enable logs to be sent to Sentry - enableLogs: true, - // ___PRODUCT_OPTION_END___ logs // ___PRODUCT_OPTION_START___ performance // Set tracesSampleRate to 1.0 to capture 100% @@ -173,11 +167,6 @@ Sentry.init({ // userInfo: false, // httpBodies: [], }, - // ___PRODUCT_OPTION_START___ logs - - // Enable logs to be sent to Sentry - enableLogs: true, - // ___PRODUCT_OPTION_END___ logs // ___PRODUCT_OPTION_START___ performance // Set tracesSampleRate to 1.0 to capture 100% @@ -227,9 +216,6 @@ export default { // ___PRODUCT_OPTION_START___ performance tracesSampleRate: 1.0, // ___PRODUCT_OPTION_END___ performance - // ___PRODUCT_OPTION_START___ logs - enableLogs: true, - // ___PRODUCT_OPTION_END___ logs dataCollection: { // To disable sending user data and HTTP bodies, uncomment the lines below. For more info visit: // https://docs.sentry.io/platforms/javascript/guides/react-router/configuration/options/#dataCollection diff --git a/docs/platforms/javascript/guides/cloudflare/frameworks/remix.mdx b/docs/platforms/javascript/guides/cloudflare/frameworks/remix.mdx index 4b197e2e393e80..e67065e7a1fcc0 100644 --- a/docs/platforms/javascript/guides/cloudflare/frameworks/remix.mdx +++ b/docs/platforms/javascript/guides/cloudflare/frameworks/remix.mdx @@ -20,7 +20,6 @@ Choose the features you want to configure, and this guide will show you how: "performance", "session-replay", "user-feedback", - "logs", ]} /> diff --git a/docs/platforms/javascript/guides/cloudflare/frameworks/tanstack-start.mdx b/docs/platforms/javascript/guides/cloudflare/frameworks/tanstack-start.mdx index 47f889863e9d2a..090085d30ac6d0 100644 --- a/docs/platforms/javascript/guides/cloudflare/frameworks/tanstack-start.mdx +++ b/docs/platforms/javascript/guides/cloudflare/frameworks/tanstack-start.mdx @@ -23,7 +23,6 @@ Choose the features you want to configure, and this guide will show you how: "performance", "session-replay", "user-feedback", - "logs", ]} /> @@ -91,11 +90,6 @@ export default Sentry.withSentry( // userInfo: false, // httpBodies: [], }, - // ___PRODUCT_OPTION_START___ logs - - // Enable logs to be sent to Sentry - enableLogs: true, - // ___PRODUCT_OPTION_END___ logs // ___PRODUCT_OPTION_START___ performance // Set tracesSampleRate to 1.0 to capture 100% of spans for tracing. @@ -177,11 +171,6 @@ export const getRouter = () => { + }), + // ___PRODUCT_OPTION_END___ user-feedback + ], -+ // ___PRODUCT_OPTION_START___ logs -+ -+ // Enable logs to be sent to Sentry -+ enableLogs: true, -+ // ___PRODUCT_OPTION_END___ logs + // ___PRODUCT_OPTION_START___ performance + + // Set tracesSampleRate to 1.0 to capture 100% of spans for tracing. diff --git a/docs/platforms/javascript/guides/cloudflare/index.mdx b/docs/platforms/javascript/guides/cloudflare/index.mdx index 69c7ec62aff846..7dc13209fa1d4f 100644 --- a/docs/platforms/javascript/guides/cloudflare/index.mdx +++ b/docs/platforms/javascript/guides/cloudflare/index.mdx @@ -35,9 +35,7 @@ Use this guide for general instructions on using the Sentry SDK with Cloudflare. Choose the features you want to configure, and this guide will show you how: - + @@ -135,11 +133,6 @@ export default Sentry.withSentry( // httpBodies: [], // genAI: { inputs: false, outputs: false }, }, - // ___PRODUCT_OPTION_START___ logs - - // Enable logs to be sent to Sentry - enableLogs: true, - // ___PRODUCT_OPTION_END___ logs // ___PRODUCT_OPTION_START___ performance // Set tracesSampleRate to 1.0 to capture 100% of spans for tracing. @@ -193,11 +186,6 @@ export const onRequest = [ // httpBodies: [], // genAI: { inputs: false, outputs: false }, }, - // ___PRODUCT_OPTION_START___ logs - - // Enable logs to be sent to Sentry - enableLogs: true, - // ___PRODUCT_OPTION_END___ logs // ___PRODUCT_OPTION_START___ performance // Set tracesSampleRate to 1.0 to capture 100% of spans for tracing. diff --git a/docs/platforms/javascript/guides/deno/index.mdx b/docs/platforms/javascript/guides/deno/index.mdx index 470b6cf9fd801f..f8033e07c5e0c9 100644 --- a/docs/platforms/javascript/guides/deno/index.mdx +++ b/docs/platforms/javascript/guides/deno/index.mdx @@ -23,9 +23,7 @@ This SDK is currently in **beta**. Beta features are still in progress and may h Choose the features you want to configure, and this guide will show you how: - + @@ -84,11 +82,6 @@ Sentry.init({ // https://docs.sentry.io/platforms/javascript/configuration/options/#traces-sample-rate tracesSampleRate: 1.0, // ___PRODUCT_OPTION_END___ performance - // ___PRODUCT_OPTION_START___ logs - - // Enable logs to be sent to Sentry - enableLogs: true, - // ___PRODUCT_OPTION_END___ logs }); ``` diff --git a/docs/platforms/javascript/guides/effect/index.mdx b/docs/platforms/javascript/guides/effect/index.mdx index e77b39975489f7..d20a50520e5dc7 100644 --- a/docs/platforms/javascript/guides/effect/index.mdx +++ b/docs/platforms/javascript/guides/effect/index.mdx @@ -97,11 +97,6 @@ const SentryLive = Layer.mergeAll( // https://docs.sentry.io/platforms/javascript/configuration/options/#traces-sample-rate tracesSampleRate: 1.0, // ___PRODUCT_OPTION_END___ performance - // ___PRODUCT_OPTION_START___ logs - - // Enable logs to be sent to Sentry - enableLogs: true, - // ___PRODUCT_OPTION_END___ logs }), // ___PRODUCT_OPTION_START___ performance @@ -145,11 +140,6 @@ const SentryLive = Layer.mergeAll( tracesSampleRate: 1.0, integrations: [Sentry.browserTracingIntegration()], // ___PRODUCT_OPTION_END___ performance - // ___PRODUCT_OPTION_START___ logs - - // Enable logs to be sent to Sentry - enableLogs: true, - // ___PRODUCT_OPTION_END___ logs }), // ___PRODUCT_OPTION_START___ performance @@ -205,11 +195,6 @@ const SentryLive = Layer.mergeAll( // We recommend adjusting this value in production. tracesSampleRate: 1.0, // ___PRODUCT_OPTION_END___ performance - // ___PRODUCT_OPTION_START___ logs - - // Enable logs to be sent to Sentry - enableLogs: true, - // ___PRODUCT_OPTION_END___ logs }), // ___PRODUCT_OPTION_START___ performance @@ -254,11 +239,6 @@ const SentryLive = Layer.mergeAll( tracesSampleRate: 1.0, integrations: [Sentry.browserTracingIntegration()], // ___PRODUCT_OPTION_END___ performance - // ___PRODUCT_OPTION_START___ logs - - // Enable logs to be sent to Sentry - enableLogs: true, - // ___PRODUCT_OPTION_END___ logs }), // ___PRODUCT_OPTION_START___ performance diff --git a/docs/platforms/javascript/guides/electron/index.mdx b/docs/platforms/javascript/guides/electron/index.mdx index 59a16cac432d8b..419a87c033e094 100644 --- a/docs/platforms/javascript/guides/electron/index.mdx +++ b/docs/platforms/javascript/guides/electron/index.mdx @@ -50,7 +50,6 @@ Choose the features you want to configure, and this guide will show you how: "performance", "session-replay", "user-feedback", - "logs", ]} /> @@ -84,11 +83,6 @@ Sentry.init({ tracesSampleRate: 1.0, integrations: [Sentry.startupTracingIntegration()], // ___PRODUCT_OPTION_END___ performance - // ___PRODUCT_OPTION_START___ logs - - // Enable logs to be sent to Sentry - enableLogs: true, - // ___PRODUCT_OPTION_END___ logs }); ``` @@ -146,11 +140,6 @@ Sentry.init({ replaysSessionSampleRate: 0.1, replaysOnErrorSampleRate: 1.0, // ___PRODUCT_OPTION_END___ session-replay - // ___PRODUCT_OPTION_START___ logs - - // Enable logs to be sent to Sentry - enableLogs: true, - // ___PRODUCT_OPTION_END___ logs }); ``` @@ -172,12 +161,7 @@ If your app uses utility processes, initialize Sentry in each one. ```javascript import * as Sentry from "@sentry/electron/utility"; -Sentry.init({ - // ___PRODUCT_OPTION_START___ logs - // Enable logs to be sent to Sentry - enableLogs: true, - // ___PRODUCT_OPTION_END___ logs -}); +Sentry.init({}); ``` diff --git a/docs/platforms/javascript/guides/elysia/index.mdx b/docs/platforms/javascript/guides/elysia/index.mdx index 66f397a8a79281..d3b567ffdff5c4 100644 --- a/docs/platforms/javascript/guides/elysia/index.mdx +++ b/docs/platforms/javascript/guides/elysia/index.mdx @@ -30,9 +30,7 @@ You need: Choose the features you want to configure, and this guide will show you how: - + @@ -100,11 +98,6 @@ Sentry.init({ // https://docs.sentry.io/platforms/javascript/guides/elysia/configuration/options/#tracesSampleRate tracesSampleRate: 1.0, // ___PRODUCT_OPTION_END___ performance - // ___PRODUCT_OPTION_START___ logs - - // Enable logs to be sent to Sentry - enableLogs: true, - // ___PRODUCT_OPTION_END___ logs }); // withElysia returns the app instance, so you can chain routes directly @@ -135,11 +128,6 @@ Sentry.init({ // https://docs.sentry.io/platforms/javascript/guides/elysia/configuration/options/#tracesSampleRate tracesSampleRate: 1.0, // ___PRODUCT_OPTION_END___ performance - // ___PRODUCT_OPTION_START___ logs - - // Enable logs to be sent to Sentry - enableLogs: true, - // ___PRODUCT_OPTION_END___ logs }); // withElysia returns the app instance, so you can chain routes directly diff --git a/docs/platforms/javascript/guides/ember/index.mdx b/docs/platforms/javascript/guides/ember/index.mdx index caaf264413d1b2..8eaa5474d28c2d 100644 --- a/docs/platforms/javascript/guides/ember/index.mdx +++ b/docs/platforms/javascript/guides/ember/index.mdx @@ -40,7 +40,6 @@ Choose the features you want to configure, and this guide will show you how: "performance", "session-replay", "user-feedback", - "logs", ]} /> @@ -86,11 +85,6 @@ Sentry.init({ // ___PRODUCT_OPTION_END___ user-feedback ], // ___PRODUCT_OPTION_END___ session-replay - // ___PRODUCT_OPTION_START___ logs - - // Enable logs to be sent to Sentry - enableLogs: true, - // ___PRODUCT_OPTION_END___ logs // ___PRODUCT_OPTION_START___ performance // Set tracesSampleRate to 1.0 to capture 100% diff --git a/docs/platforms/javascript/guides/firebase/index.mdx b/docs/platforms/javascript/guides/firebase/index.mdx index 3fb5759d70a1c2..5f2f545b038294 100644 --- a/docs/platforms/javascript/guides/firebase/index.mdx +++ b/docs/platforms/javascript/guides/firebase/index.mdx @@ -32,7 +32,7 @@ This integration is enabled by default, so you get automatic performance monitor Choose the features you want to configure, and this guide will show you how: @@ -122,10 +122,6 @@ Sentry.init({ // This is relative to tracesSampleRate profilesSampleRate: 1.0, // ___PRODUCT_OPTION_END___ profiling - // ___PRODUCT_OPTION_START___ logs - // Enable logs to be sent to Sentry - enableLogs: true, - // ___PRODUCT_OPTION_END___ logs }); ``` diff --git a/docs/platforms/javascript/guides/gatsby/index.mdx b/docs/platforms/javascript/guides/gatsby/index.mdx index 989a631ba9825a..be5192783e19e0 100644 --- a/docs/platforms/javascript/guides/gatsby/index.mdx +++ b/docs/platforms/javascript/guides/gatsby/index.mdx @@ -96,7 +96,6 @@ Choose the features you want to configure, and this guide will show you how: "performance", "session-replay", "user-feedback", - "logs", ]} /> @@ -140,11 +139,6 @@ Sentry.init({ }), // ___PRODUCT_OPTION_END___ user-feedback ], - // ___PRODUCT_OPTION_START___ logs - - // Enable logs to be sent to Sentry - enableLogs: true, - // ___PRODUCT_OPTION_END___ logs // ___PRODUCT_OPTION_START___ performance // Set tracesSampleRate to 1.0 to capture 100% diff --git a/docs/platforms/javascript/guides/gcp-functions/index.mdx b/docs/platforms/javascript/guides/gcp-functions/index.mdx index b6b393f7a62ff7..6a81e3b5326e95 100644 --- a/docs/platforms/javascript/guides/gcp-functions/index.mdx +++ b/docs/platforms/javascript/guides/gcp-functions/index.mdx @@ -30,7 +30,7 @@ categories: Choose the features you want to configure, and this guide will show you how: diff --git a/docs/platforms/javascript/guides/hono/index.mdx b/docs/platforms/javascript/guides/hono/index.mdx index bd327f73294619..86f995e42375ee 100644 --- a/docs/platforms/javascript/guides/hono/index.mdx +++ b/docs/platforms/javascript/guides/hono/index.mdx @@ -30,7 +30,7 @@ The community middleware `@hono/sentry` has been deprecated in favor of `@sentry Choose the features you want to configure, and this guide will show you how: @@ -200,11 +200,6 @@ Sentry.init({ // https://docs.sentry.io/platforms/javascript/configuration/options/#profileSessionSampleRate profileSessionSampleRate: 1.0, // ___PRODUCT_OPTION_END___ profiling - // ___PRODUCT_OPTION_START___ logs - - // Enable logs to be sent to Sentry - enableLogs: true, - // ___PRODUCT_OPTION_END___ logs }); ``` @@ -270,11 +265,6 @@ app.use( // of spans for tracing. tracesSampleRate: 1.0, // ___PRODUCT_OPTION_END___ performance - // ___PRODUCT_OPTION_START___ logs - - // Enable logs to be sent to Sentry - enableLogs: true, - // ___PRODUCT_OPTION_END___ logs }) ); @@ -319,11 +309,6 @@ app.use( // of spans for tracing. tracesSampleRate: 1.0, // ___PRODUCT_OPTION_END___ performance - // ___PRODUCT_OPTION_START___ logs - - // Enable logs to be sent to Sentry - enableLogs: true, - // ___PRODUCT_OPTION_END___ logs }) ); @@ -354,11 +339,6 @@ app.use( // of spans for tracing. tracesSampleRate: 1.0, // ___PRODUCT_OPTION_END___ performance - // ___PRODUCT_OPTION_START___ logs - - // Enable logs to be sent to Sentry - enableLogs: true, - // ___PRODUCT_OPTION_END___ logs }) ); diff --git a/docs/platforms/javascript/guides/nestjs/index.mdx b/docs/platforms/javascript/guides/nestjs/index.mdx index 488eec35479e87..3859668bb79633 100644 --- a/docs/platforms/javascript/guides/nestjs/index.mdx +++ b/docs/platforms/javascript/guides/nestjs/index.mdx @@ -20,7 +20,7 @@ categories: Choose the features you want to configure, and this guide will show you how: diff --git a/docs/platforms/javascript/guides/nextjs/index.mdx b/docs/platforms/javascript/guides/nextjs/index.mdx index 59dbf5b0808c04..42fec00172724b 100644 --- a/docs/platforms/javascript/guides/nextjs/index.mdx +++ b/docs/platforms/javascript/guides/nextjs/index.mdx @@ -30,7 +30,6 @@ The wizard will prompt you to select features. Choose the ones you want to enabl "error-monitoring", { id: "performance", checked: true }, "session-replay", - { id: "logs", checked: true }, ]} /> @@ -75,9 +74,6 @@ Sentry.init({ replaysSessionSampleRate: 0.1, replaysOnErrorSampleRate: 1.0, // ___PRODUCT_OPTION_END___ session-replay - // ___PRODUCT_OPTION_START___ logs - enableLogs: true, - // ___PRODUCT_OPTION_END___ logs integrations: [ // ___PRODUCT_OPTION_START___ session-replay Sentry.replayIntegration(), @@ -101,9 +97,6 @@ Sentry.init({ // ___PRODUCT_OPTION_START___ performance tracesSampleRate: process.env.NODE_ENV === "development" ? 1.0 : 0.1, // ___PRODUCT_OPTION_END___ performance - // ___PRODUCT_OPTION_START___ logs - enableLogs: true, - // ___PRODUCT_OPTION_END___ logs }); ``` @@ -122,9 +115,6 @@ Sentry.init({ // ___PRODUCT_OPTION_START___ performance tracesSampleRate: process.env.NODE_ENV === "development" ? 1.0 : 0.1, // ___PRODUCT_OPTION_END___ performance - // ___PRODUCT_OPTION_START___ logs - enableLogs: true, - // ___PRODUCT_OPTION_END___ logs }); ``` diff --git a/docs/platforms/javascript/guides/nextjs/logs/index.mdx b/docs/platforms/javascript/guides/nextjs/logs/index.mdx index 3c5272c6796ef6..87d9d22a9ee430 100644 --- a/docs/platforms/javascript/guides/nextjs/logs/index.mdx +++ b/docs/platforms/javascript/guides/nextjs/logs/index.mdx @@ -18,7 +18,7 @@ Sentry Logs let you send structured log data from your Next.js application. Unli ### Enable Logging -Add `enableLogs: true` to your Sentry configuration in all three runtime files. +Logs are enabled by default across all three runtime files. Initialize the SDK as usual, then use `Sentry.logger` to send logs. Logs work across all Next.js runtimes: @@ -26,6 +26,11 @@ Logs work across all Next.js runtimes: - **Server** — Node.js server-side logging - **Edge** — Edge runtime logging + + On SDK versions below `10.71.0`, logs are opt-in — you must set `enableLogs: + true` in your `Sentry.init` in all three runtime files. + + @@ -34,7 +39,6 @@ import * as Sentry from "@sentry/nextjs"; Sentry.init({ dsn: "___PUBLIC_DSN___", - enableLogs: true, }); ``` @@ -43,7 +47,6 @@ import * as Sentry from "@sentry/nextjs"; Sentry.init({ dsn: "___PUBLIC_DSN___", - enableLogs: true, }); ``` @@ -52,7 +55,6 @@ import * as Sentry from "@sentry/nextjs"; Sentry.init({ dsn: "___PUBLIC_DSN___", - enableLogs: true, }); ``` @@ -189,7 +191,6 @@ The integration parses multiple arguments as searchable attributes. ```typescript Sentry.init({ dsn: "___PUBLIC_DSN___", - enableLogs: true, integrations: [ Sentry.consoleLoggingIntegration({ levels: ["log", "warn", "error"], @@ -221,7 +222,6 @@ Requires SDK version `10.18.0` or higher. ```typescript Sentry.init({ dsn: "___PUBLIC_DSN___", - enableLogs: true, integrations: [Sentry.pinoIntegration()], }); ``` @@ -238,7 +238,7 @@ See Pino integration docs

@@ -263,7 +263,7 @@ consola.addReporter(sentryReporter); Send logs from the [Winston](https://github.com/winstonjs/winston) logging library to Sentry. -Requires SDK version `9.13.0` or higher and `enableLogs: true` in your `Sentry.init` call. +Requires SDK version `9.13.0` or higher. @@ -314,8 +314,6 @@ Use this to: ```typescript {filename:instrumentation-client.ts} Sentry.init({ dsn: "___PUBLIC_DSN___", - enableLogs: true, - beforeSendLog(log) { // Drop debug logs in production if (log.level === "debug") { @@ -383,12 +381,11 @@ Sentry automatically adds these attributes to every log: Any attributes set via `Sentry.setAttribute()` / `Sentry.setAttributes()` (or directly on a scope) are automatically included on all logs. `Sentry.setAttribute(s)` requires SDK version `10.61.0` or above. See [Shared Attributes](#shared-attributes) above for details. - ## Troubleshooting ### Logs not appearing -Make sure `enableLogs: true` is set in **all** Sentry config files: +On SDK versions below `10.71.0`, logs are opt-in. Make sure `enableLogs: true` is set in **all** Sentry config files: - `instrumentation-client.ts` (client) - `sentry.server.config.ts` (server) diff --git a/docs/platforms/javascript/guides/nextjs/manual-setup/index.mdx b/docs/platforms/javascript/guides/nextjs/manual-setup/index.mdx index 14b87f8a840ded..1e224bfd105877 100644 --- a/docs/platforms/javascript/guides/nextjs/manual-setup/index.mdx +++ b/docs/platforms/javascript/guides/nextjs/manual-setup/index.mdx @@ -30,7 +30,6 @@ Choose the features you want to configure: { id: "performance", checked: true }, "session-replay", "user-feedback", - { id: "logs", checked: true }, ]} /> @@ -161,11 +160,6 @@ Sentry.init({ replaysSessionSampleRate: 0.1, replaysOnErrorSampleRate: 1.0, // ___PRODUCT_OPTION_END___ session-replay - // ___PRODUCT_OPTION_START___ logs - - // Enable logs to be sent to Sentry - enableLogs: true, - // ___PRODUCT_OPTION_END___ logs }); // ___PRODUCT_OPTION_START___ performance @@ -192,11 +186,6 @@ Sentry.init({ // Adjust based on your traffic volume tracesSampleRate: process.env.NODE_ENV === "development" ? 1.0 : 0.1, // ___PRODUCT_OPTION_END___ performance - // ___PRODUCT_OPTION_START___ logs - - // Enable logs to be sent to Sentry - enableLogs: true, - // ___PRODUCT_OPTION_END___ logs }); ``` @@ -218,11 +207,6 @@ Sentry.init({ // Adjust based on your traffic volume tracesSampleRate: process.env.NODE_ENV === "development" ? 1.0 : 0.1, // ___PRODUCT_OPTION_END___ performance - // ___PRODUCT_OPTION_START___ logs - - // Enable logs to be sent to Sentry - enableLogs: true, - // ___PRODUCT_OPTION_END___ logs }); ``` @@ -522,7 +506,7 @@ const result = await Sentry.startSpan( ### Logs -Logs are enabled with `enableLogs: true` in your SDK config. Use the Sentry logger to send structured logs from anywhere in your application. +Logs are enabled by default. Use the Sentry logger to send structured logs from anywhere in your application. Connect popular logging libraries via [Integrations](/platforms/javascript/guides/nextjs/logs/#integrations). diff --git a/docs/platforms/javascript/guides/nextjs/manual-setup/pages-router.mdx b/docs/platforms/javascript/guides/nextjs/manual-setup/pages-router.mdx index 80f659e11526ff..cd9cb10ad54116 100644 --- a/docs/platforms/javascript/guides/nextjs/manual-setup/pages-router.mdx +++ b/docs/platforms/javascript/guides/nextjs/manual-setup/pages-router.mdx @@ -23,7 +23,6 @@ Choose the features you want to configure: "error-monitoring", { id: "performance", checked: true }, "session-replay", - { id: "logs", checked: true }, ]} /> @@ -180,11 +179,6 @@ Sentry.init({ replaysSessionSampleRate: 0.1, replaysOnErrorSampleRate: 1.0, // ___PRODUCT_OPTION_END___ session-replay - // ___PRODUCT_OPTION_START___ logs - - // Enable logs to be sent to Sentry - enableLogs: true, - // ___PRODUCT_OPTION_END___ logs }); ``` @@ -206,11 +200,6 @@ Sentry.init({ // Adjust based on your traffic volume tracesSampleRate: process.env.NODE_ENV === "development" ? 1.0 : 0.1, // ___PRODUCT_OPTION_END___ performance - // ___PRODUCT_OPTION_START___ logs - - // Enable logs to be sent to Sentry - enableLogs: true, - // ___PRODUCT_OPTION_END___ logs }); ``` @@ -232,11 +221,6 @@ Sentry.init({ // Adjust based on your traffic volume tracesSampleRate: process.env.NODE_ENV === "development" ? 1.0 : 0.1, // ___PRODUCT_OPTION_END___ performance - // ___PRODUCT_OPTION_START___ logs - - // Enable logs to be sent to Sentry - enableLogs: true, - // ___PRODUCT_OPTION_END___ logs }); ``` @@ -420,7 +404,7 @@ Sentry.init({ ### Logs -Logs are enabled with `enableLogs: true` in your SDK config. Use the Sentry logger to send structured logs. +Logs are enabled by default. Use the Sentry logger to send structured logs. **Verify:** Add a log statement, trigger it, then check [**Logs**](https://sentry.io/orgredirect/organizations/:orgslug/explore/logs/) in Sentry. diff --git a/docs/platforms/javascript/guides/nitro/index.mdx b/docs/platforms/javascript/guides/nitro/index.mdx index c8c6a092bc57bc..831578dd6d6f8a 100644 --- a/docs/platforms/javascript/guides/nitro/index.mdx +++ b/docs/platforms/javascript/guides/nitro/index.mdx @@ -29,9 +29,7 @@ You need: Choose the features you want to configure, and this guide will show you how: - + @@ -156,11 +154,6 @@ Sentry.init({ // https://docs.sentry.io/platforms/javascript/guides/nitro/configuration/options/#tracesSampleRate tracesSampleRate: 1.0, // ___PRODUCT_OPTION_END___ performance - // ___PRODUCT_OPTION_START___ logs - - // Enable logs to be sent to Sentry - enableLogs: true, - // ___PRODUCT_OPTION_END___ logs }); ``` diff --git a/docs/platforms/javascript/guides/react-router/index.mdx b/docs/platforms/javascript/guides/react-router/index.mdx index d2e5e1fb1f791e..21126552a05429 100644 --- a/docs/platforms/javascript/guides/react-router/index.mdx +++ b/docs/platforms/javascript/guides/react-router/index.mdx @@ -55,7 +55,6 @@ Select which Sentry features you'd like to install in addition to Error Monitori "performance", "session-replay", "user-feedback", - "logs", { id: "profiling", checked: false, @@ -113,11 +112,6 @@ Sentry.init({ }), // ___PRODUCT_OPTION_END___ user-feedback ], - // ___PRODUCT_OPTION_START___ logs - - // Enable logs to be sent to Sentry - enableLogs: true, - // ___PRODUCT_OPTION_END___ logs // ___PRODUCT_OPTION_START___ performance // Set tracesSampleRate to 1.0 to capture 100% @@ -181,11 +175,6 @@ Sentry.init({ // userInfo: false, // httpBodies: [], }, - // ___PRODUCT_OPTION_START___ logs - - // Enable logs to be sent to Sentry - enableLogs: true, - // ___PRODUCT_OPTION_END___ logs // ___PRODUCT_OPTION_START___ profiling // Add our Profiling integration diff --git a/docs/platforms/javascript/guides/react-router/manual-setup.mdx b/docs/platforms/javascript/guides/react-router/manual-setup.mdx index de8e7357d11549..4456213a09b636 100644 --- a/docs/platforms/javascript/guides/react-router/manual-setup.mdx +++ b/docs/platforms/javascript/guides/react-router/manual-setup.mdx @@ -27,7 +27,6 @@ Choose the features you want to configure, and this guide will show you how: "performance", "session-replay", "user-feedback", - "logs", { id: "profiling", checked: false, @@ -152,11 +151,6 @@ The `sentryOnError` handler integrates with React Router's [`onError` hook](http + }), + // ___PRODUCT_OPTION_END___ user-feedback + ], -+ // ___PRODUCT_OPTION_START___ logs -+ -+ // Enable logs to be sent to Sentry -+ enableLogs: true, -+ // ___PRODUCT_OPTION_END___ logs + // ___PRODUCT_OPTION_START___ performance + + // Set tracesSampleRate to 1.0 to capture 100% @@ -233,11 +227,6 @@ Sentry.init({ // userInfo: false, // httpBodies: [], }, - // ___PRODUCT_OPTION_START___ logs - - // Enable logs to be sent to Sentry - enableLogs: true, - // ___PRODUCT_OPTION_END___ logs // ___PRODUCT_OPTION_START___ profiling // Add our Profiling integration diff --git a/docs/platforms/javascript/guides/react/index.mdx b/docs/platforms/javascript/guides/react/index.mdx index a3b78eecd192fb..45fe635258a134 100644 --- a/docs/platforms/javascript/guides/react/index.mdx +++ b/docs/platforms/javascript/guides/react/index.mdx @@ -51,7 +51,6 @@ Choose the features you want to configure: "performance", "session-replay", "user-feedback", - "logs", ]} /> @@ -101,11 +100,6 @@ Sentry.init({ }), // ___PRODUCT_OPTION_END___ user-feedback ], - // ___PRODUCT_OPTION_START___ logs - - // Enable logs to be sent to Sentry - enableLogs: true, - // ___PRODUCT_OPTION_END___ logs // ___PRODUCT_OPTION_START___ performance // Set tracesSampleRate to 1.0 to capture 100% diff --git a/docs/platforms/javascript/guides/remix/manual-setup.mdx b/docs/platforms/javascript/guides/remix/manual-setup.mdx index d602cb7a3b8457..4a4b244114809a 100644 --- a/docs/platforms/javascript/guides/remix/manual-setup.mdx +++ b/docs/platforms/javascript/guides/remix/manual-setup.mdx @@ -27,7 +27,6 @@ Choose the features you want to configure, and this guide will show you how: "profiling", "session-replay", "user-feedback", - "logs", ]} /> diff --git a/docs/platforms/javascript/guides/solid/index.mdx b/docs/platforms/javascript/guides/solid/index.mdx index e2b442ec986057..3cc168d751ceed 100644 --- a/docs/platforms/javascript/guides/solid/index.mdx +++ b/docs/platforms/javascript/guides/solid/index.mdx @@ -54,7 +54,6 @@ Choose the features you want to configure, and this guide will show you how: "performance", "session-replay", "user-feedback", - "logs", ]} /> @@ -106,11 +105,6 @@ if (!DEV) { }), // ___PRODUCT_OPTION_END___ user-feedback ], - // ___PRODUCT_OPTION_START___ logs - - // Enable logs to be sent to Sentry - enableLogs: true, - // ___PRODUCT_OPTION_END___ logs // ___PRODUCT_OPTION_START___ performance // Set tracesSampleRate to 1.0 to capture 100% diff --git a/docs/platforms/javascript/guides/solidstart/index.mdx b/docs/platforms/javascript/guides/solidstart/index.mdx index 2bf0bda7cd27ee..6b6f9a5e3307b4 100644 --- a/docs/platforms/javascript/guides/solidstart/index.mdx +++ b/docs/platforms/javascript/guides/solidstart/index.mdx @@ -32,7 +32,6 @@ Choose the features you want to configure, and this guide will show you how: "performance", "session-replay", "user-feedback", - "logs", ]} /> @@ -141,11 +140,6 @@ Sentry.init({ replaysSessionSampleRate: 0.1, replaysOnErrorSampleRate: 1.0, // ___PRODUCT_OPTION_END___ session-replay - // ___PRODUCT_OPTION_START___ logs - - // Enable logs to be sent to Sentry - enableLogs: true, - // ___PRODUCT_OPTION_END___ logs }); mount(() => , document.getElementById("app")); @@ -186,11 +180,6 @@ Sentry.init({ // https://docs.sentry.io/platforms/javascript/configuration/options/#traces-sample-rate tracesSampleRate: 1.0, // ___PRODUCT_OPTION_END___ performance - // ___PRODUCT_OPTION_START___ logs - - // Enable logs to be sent to Sentry - enableLogs: true, - // ___PRODUCT_OPTION_END___ logs }); ``` diff --git a/docs/platforms/javascript/guides/svelte/index.mdx b/docs/platforms/javascript/guides/svelte/index.mdx index cee4ca62579bbc..bb03cc7bd70d3d 100644 --- a/docs/platforms/javascript/guides/svelte/index.mdx +++ b/docs/platforms/javascript/guides/svelte/index.mdx @@ -52,7 +52,6 @@ Choose the features you want to configure, and this guide will show you how: "performance", "session-replay", "user-feedback", - "logs", ]} /> @@ -99,11 +98,6 @@ Sentry.init({ }), // ___PRODUCT_OPTION_END___ user-feedback ], - // ___PRODUCT_OPTION_START___ logs - - // Enable logs to be sent to Sentry - enableLogs: true, - // ___PRODUCT_OPTION_END___ logs // ___PRODUCT_OPTION_START___ performance // Set tracesSampleRate to 1.0 to capture 100% @@ -157,11 +151,6 @@ Sentry.init({ }), // ___PRODUCT_OPTION_END___ user-feedback ], - // ___PRODUCT_OPTION_START___ logs - - // Enable logs to be sent to Sentry - enableLogs: true, - // ___PRODUCT_OPTION_END___ logs // ___PRODUCT_OPTION_START___ performance // Set tracesSampleRate to 1.0 to capture 100% diff --git a/docs/platforms/javascript/guides/sveltekit/manual-setup__v10.7.0.mdx b/docs/platforms/javascript/guides/sveltekit/manual-setup__v10.7.0.mdx index fa58ed4f67ef56..b72415f6ac2285 100644 --- a/docs/platforms/javascript/guides/sveltekit/manual-setup__v10.7.0.mdx +++ b/docs/platforms/javascript/guides/sveltekit/manual-setup__v10.7.0.mdx @@ -45,7 +45,6 @@ Choose the features you want to configure, and this guide will show you how: "performance", "session-replay", "user-feedback", - "logs", ]} /> @@ -115,11 +114,6 @@ Sentry.init({ replaysSessionSampleRate: 0.1, replaysOnErrorSampleRate: 1.0, // ___PRODUCT_OPTION_END___ session-replay - // ___PRODUCT_OPTION_START___ logs - - // Enable logs to be sent to Sentry - enableLogs: true, - // ___PRODUCT_OPTION_END___ logs }); const myErrorHandler = ({ error, event }) => { @@ -154,11 +148,6 @@ Sentry.init({ // https://docs.sentry.io/platforms/javascript/configuration/options/#traces-sample-rate tracesSampleRate: 1.0, // ___PRODUCT_OPTION_END___ performance - // ___PRODUCT_OPTION_START___ logs - - // Enable logs to be sent to Sentry - enableLogs: true, - // ___PRODUCT_OPTION_END___ logs }); const myErrorHandler = ({ error, event }) => { diff --git a/docs/platforms/javascript/guides/tanstackstart-react/index.mdx b/docs/platforms/javascript/guides/tanstackstart-react/index.mdx index 2aabba6516e866..b9b9ad1e178548 100644 --- a/docs/platforms/javascript/guides/tanstackstart-react/index.mdx +++ b/docs/platforms/javascript/guides/tanstackstart-react/index.mdx @@ -42,7 +42,6 @@ The wizard will have prompted you to select which features to enable. Select the "performance", "session-replay", "user-feedback", - { id: "logs", checked: true }, ]} /> diff --git a/docs/platforms/javascript/guides/tanstackstart-react/manual-setup/index.mdx b/docs/platforms/javascript/guides/tanstackstart-react/manual-setup/index.mdx index 31c148f92bcef3..dadf7f3a9c1e00 100644 --- a/docs/platforms/javascript/guides/tanstackstart-react/manual-setup/index.mdx +++ b/docs/platforms/javascript/guides/tanstackstart-react/manual-setup/index.mdx @@ -36,7 +36,6 @@ Choose the features you want to configure, and this guide will show you how: "performance", "session-replay", "user-feedback", - "logs", ]} /> @@ -106,11 +105,6 @@ Sentry.init({ }), // ___PRODUCT_OPTION_END___ user-feedback ], - // ___PRODUCT_OPTION_START___ logs - - // Enable logs to be sent to Sentry - enableLogs: true, - // ___PRODUCT_OPTION_END___ logs // ___PRODUCT_OPTION_START___ performance // Set tracesSampleRate to 1.0 to capture 100% @@ -221,11 +215,6 @@ Sentry.init({ // userInfo: false, // httpBodies: [], }, - // ___PRODUCT_OPTION_START___ logs - - // Enable logs to be sent to Sentry - enableLogs: true, - // ___PRODUCT_OPTION_END___ logs // ___PRODUCT_OPTION_START___ performance // Set tracesSampleRate to 1.0 to capture 100% diff --git a/docs/platforms/javascript/guides/vue/index.mdx b/docs/platforms/javascript/guides/vue/index.mdx index 566dd5548faf04..a02d37ecb63524 100644 --- a/docs/platforms/javascript/guides/vue/index.mdx +++ b/docs/platforms/javascript/guides/vue/index.mdx @@ -48,7 +48,6 @@ Choose the features you want to configure, and this guide will show you how: "performance", "session-replay", "user-feedback", - "logs", ]} /> @@ -106,11 +105,6 @@ Sentry.init({ }), // ___PRODUCT_OPTION_END___ user-feedback ], - // ___PRODUCT_OPTION_START___ logs - - // Enable logs to be sent to Sentry - enableLogs: true, - // ___PRODUCT_OPTION_END___ logs // ___PRODUCT_OPTION_START___ performance // Set tracesSampleRate to 1.0 to capture 100% @@ -166,11 +160,6 @@ Sentry.init({ }), // ___PRODUCT_OPTION_END___ user-feedback ], - // ___PRODUCT_OPTION_START___ logs - - // Enable logs to be sent to Sentry - enableLogs: true, - // ___PRODUCT_OPTION_END___ logs // ___PRODUCT_OPTION_START___ performance // Set tracesSampleRate to 1.0 to capture 100% diff --git a/docs/platforms/javascript/guides/wasm/index.mdx b/docs/platforms/javascript/guides/wasm/index.mdx index 243892df555c0b..4e7eb81ab5d550 100644 --- a/docs/platforms/javascript/guides/wasm/index.mdx +++ b/docs/platforms/javascript/guides/wasm/index.mdx @@ -23,9 +23,7 @@ categories: Choose the features you want to configure, and this guide will show you how: - + @@ -96,11 +94,6 @@ Sentry.init({ // Set `tracePropagationTargets` to control for which URLs trace propagation should be enabled tracePropagationTargets: ["localhost", /^https:\/\/yourserver\.io\/api/], // ___PRODUCT_OPTION_END___ performance - // ___PRODUCT_OPTION_START___ logs - - // Enable logs to be sent to Sentry - enableLogs: true, - // ___PRODUCT_OPTION_END___ logs }); ``` diff --git a/includes/logs/default-attributes/integration-filter-example/javascript.mdx b/includes/logs/default-attributes/integration-filter-example/javascript.mdx index bd50fd860da048..cbbaeb47d716f1 100644 --- a/includes/logs/default-attributes/integration-filter-example/javascript.mdx +++ b/includes/logs/default-attributes/integration-filter-example/javascript.mdx @@ -3,7 +3,6 @@ To filter out all SDK-generated logs and keep only your application logs, use th ```js Sentry.init({ dsn: "___PUBLIC_DSN___", - enableLogs: true, beforeSendLog: (log) => { if (log.attributes?.["sentry.origin"] !== undefined) { return null; diff --git a/includes/logs/javascript-consola-integration.mdx b/includes/logs/javascript-consola-integration.mdx index 7bcc77ca415a55..4935cb53346c3c 100644 --- a/includes/logs/javascript-consola-integration.mdx +++ b/includes/logs/javascript-consola-integration.mdx @@ -1,6 +1,11 @@ ### Consola Integration -In `10.12.0` and above of the JavaScript SDKs, we've added support to send logs via the [consola](https://github.com/unjs/consola) logging library. Requires `enableLogs: true` in your `Sentry.init` call. +In `10.12.0` and above of the JavaScript SDKs, we've added support to send logs via the [consola](https://github.com/unjs/consola) logging library. + + + On SDK versions below `10.71.0`, you must also set `enableLogs: true` in your + `Sentry.init` to send logs. + ```js import { consola } from "consola"; diff --git a/includes/logs/javascript-console-logging-integration.mdx b/includes/logs/javascript-console-logging-integration.mdx index 58977fb8f54c52..0e3ffa839c72ce 100644 --- a/includes/logs/javascript-console-logging-integration.mdx +++ b/includes/logs/javascript-console-logging-integration.mdx @@ -2,10 +2,14 @@ You can also configure the SDK to send logs via the JavaScript console object, using the SDK's `consoleLoggingIntegration`. + + On SDK versions below `10.71.0`, you must also set `enableLogs: true` in your + `Sentry.init` to send logs. + + ```js Sentry.init({ dsn: "___PUBLIC_DSN___", - enableLogs: true, integrations: [ // send console.log, console.warn, and console.error calls as logs to Sentry Sentry.consoleLoggingIntegration({ levels: ["log", "warn", "error"] }), diff --git a/includes/logs/javascript-pino-integration.mdx b/includes/logs/javascript-pino-integration.mdx index 23ff57d15eff06..bb584d2b8f5fb5 100644 --- a/includes/logs/javascript-pino-integration.mdx +++ b/includes/logs/javascript-pino-integration.mdx @@ -2,9 +2,13 @@ In `10.18.0` and above of the JavaScript SDKs, we've added support to send logs via the pino logging library. To add the pino integration, you need to add the `pinoIntegration` to your Sentry initialization. + + On SDK versions below `10.71.0`, you must also set `enableLogs: true` in your + `Sentry.init` to send logs. + + ```js Sentry.init({ - enableLogs: true, integrations: [Sentry.pinoIntegration()], }); ``` diff --git a/includes/logs/javascript-winston-integration.mdx b/includes/logs/javascript-winston-integration.mdx index b7f9896eae1d0a..0ffb59ea0e2f34 100644 --- a/includes/logs/javascript-winston-integration.mdx +++ b/includes/logs/javascript-winston-integration.mdx @@ -1,6 +1,11 @@ ### Winston Integration -In `9.13.0` and above of the JavaScript SDKs, we've added support to send logs via the winston logging library. Requires `enableLogs: true` in your `Sentry.init` call. +In `9.13.0` and above of the JavaScript SDKs, we've added support to send logs via the winston logging library. + + + On SDK versions below `10.71.0`, you must also set `enableLogs: true` in your + `Sentry.init` to send logs. + ```js const winston = require("winston"); diff --git a/platform-includes/configuration/console-logs-vs-breadcrumbs/_default.mdx b/platform-includes/configuration/console-logs-vs-breadcrumbs/_default.mdx index cd278b74cadfc6..147b0dd4185a0e 100644 --- a/platform-includes/configuration/console-logs-vs-breadcrumbs/_default.mdx +++ b/platform-includes/configuration/console-logs-vs-breadcrumbs/_default.mdx @@ -5,9 +5,8 @@ -This integration captures console logs as breadcrumbs (great for error context!). But if you need to search and query your logs across your entire application, use Sentry Logs instead. Set `enableLogs: true`, and add the Sentry console logging integration in your SDK config. +This integration captures console logs as breadcrumbs (great for error context!). But if you need to search and query your logs across your entire application, use Sentry Logs instead, and add the Sentry console logging integration in your SDK config. - diff --git a/platform-includes/getting-started-complete/javascript.astro.mdx b/platform-includes/getting-started-complete/javascript.astro.mdx index 2e20147c82470f..5f86a9afbb2a2a 100644 --- a/platform-includes/getting-started-complete/javascript.astro.mdx +++ b/platform-includes/getting-started-complete/javascript.astro.mdx @@ -142,10 +142,6 @@ export default Sentry.withSentry( // or use tracesSampler for greater control. tracesSampleRate: 1.0, // ___PRODUCT_OPTION_END___ performance - // ___PRODUCT_OPTION_START___ logs - // Enable logs to be sent to Sentry - enableLogs: true, - // ___PRODUCT_OPTION_END___ logs }), handler ); @@ -264,11 +260,6 @@ Sentry.init({ // sessions when an error occurs. replaysOnErrorSampleRate: 1.0, // ___PRODUCT_OPTION_END___ session-replay - // ___PRODUCT_OPTION_START___ logs - - // Enable logs to be sent to Sentry - enableLogs: true, - // ___PRODUCT_OPTION_END___ logs }); ``` @@ -360,11 +351,6 @@ Sentry.init({ // Define how many user sessions have profiling enabled. profileSessionSampleRate: 1.0, // ___PRODUCT_OPTION_END___ profiling - // ___PRODUCT_OPTION_START___ logs - - // Enable logs to be sent to Sentry - enableLogs: true, - // ___PRODUCT_OPTION_END___ logs }); ``` diff --git a/platform-includes/getting-started-complete/javascript.mdx b/platform-includes/getting-started-complete/javascript.mdx index 3a1b63f945dc5c..23658a8d90099e 100644 --- a/platform-includes/getting-started-complete/javascript.mdx +++ b/platform-includes/getting-started-complete/javascript.mdx @@ -7,7 +7,6 @@ Choose the features you want to configure, and this guide will show you how: "performance", "session-replay", "user-feedback", - "logs", ]} /> diff --git a/platform-includes/getting-started-complete/javascript.nuxt.mdx b/platform-includes/getting-started-complete/javascript.nuxt.mdx index 51b199cfadafcd..2ad1969a746c52 100644 --- a/platform-includes/getting-started-complete/javascript.nuxt.mdx +++ b/platform-includes/getting-started-complete/javascript.nuxt.mdx @@ -15,7 +15,6 @@ Choose the features you want to configure, and this guide will show you how: "performance", "session-replay", "user-feedback", - "logs", ]} /> @@ -138,11 +137,6 @@ Sentry.init({ replaysSessionSampleRate: 0.1, replaysOnErrorSampleRate: 1.0, // ___PRODUCT_OPTION_END___ session-replay - // ___PRODUCT_OPTION_START___ logs - - // Enable logs to be sent to Sentry - enableLogs: true, - // ___PRODUCT_OPTION_END___ logs }); ``` @@ -204,11 +198,6 @@ Sentry.init({ // https://docs.sentry.io/platforms/javascript/configuration/options/#traces-sample-rate tracesSampleRate: 1.0, // ___PRODUCT_OPTION_END___ performance - // ___PRODUCT_OPTION_START___ logs - - // Enable logs to be sent to Sentry - enableLogs: true, - // ___PRODUCT_OPTION_END___ logs }); ``` diff --git a/platform-includes/getting-started-complete/javascript.remix.mdx b/platform-includes/getting-started-complete/javascript.remix.mdx index e60c0a31c32e61..9e240377c4c78e 100644 --- a/platform-includes/getting-started-complete/javascript.remix.mdx +++ b/platform-includes/getting-started-complete/javascript.remix.mdx @@ -66,11 +66,6 @@ Sentry.init({ replaysSessionSampleRate: 0.1, replaysOnErrorSampleRate: 1.0, // ___PRODUCT_OPTION_END___ session-replay - // ___PRODUCT_OPTION_START___ logs - - // Enable logs to be sent to Sentry - enableLogs: true, - // ___PRODUCT_OPTION_END___ logs }); ``` @@ -203,11 +198,6 @@ Sentry.init({ // https://docs.sentry.io/platforms/javascript/configuration/options/#profileSessionSampleRate profileSessionSampleRate: 1.0, // ___PRODUCT_OPTION_END___ profiling - // ___PRODUCT_OPTION_START___ logs - - // Enable logs to be sent to Sentry - enableLogs: true, - // ___PRODUCT_OPTION_END___ logs // Optionally capture action formData attributes with errors. // This requires `sendDefaultPii` set to true as well. @@ -304,11 +294,6 @@ export const onRequest = [ // https://docs.sentry.io/platforms/javascript/configuration/options/#traces-sample-rate tracesSampleRate: 1.0, // ___PRODUCT_OPTION_END___ performance - // ___PRODUCT_OPTION_START___ logs - - // Enable logs to be sent to Sentry - enableLogs: true, - // ___PRODUCT_OPTION_END___ logs // Optionally capture action formData attributes with errors. // This requires `sendDefaultPii` set to true as well. diff --git a/platform-includes/getting-started-complete/javascript.sveltekit.mdx b/platform-includes/getting-started-complete/javascript.sveltekit.mdx index 04737b32817add..c557aec4777c16 100644 --- a/platform-includes/getting-started-complete/javascript.sveltekit.mdx +++ b/platform-includes/getting-started-complete/javascript.sveltekit.mdx @@ -63,7 +63,6 @@ Choose the features you want to configure, and this guide will show you how: "performance", "session-replay", "user-feedback", - "logs", ]} /> @@ -165,11 +164,6 @@ Sentry.init({ replaysSessionSampleRate: 0.1, replaysOnErrorSampleRate: 1.0, // ___PRODUCT_OPTION_END___ session-replay - // ___PRODUCT_OPTION_START___ logs - - // Enable logs to be sent to Sentry - enableLogs: true, - // ___PRODUCT_OPTION_END___ logs }); const myErrorHandler = ({ error, event }) => { @@ -272,11 +266,6 @@ Sentry.init({ // https://docs.sentry.io/platforms/javascript/configuration/options/#traces-sample-rate tracesSampleRate: 1.0, // ___PRODUCT_OPTION_END___ performance - // ___PRODUCT_OPTION_START___ logs - - // Enable logs to be sent to Sentry - enableLogs: true, - // ___PRODUCT_OPTION_END___ logs }); ``` @@ -358,11 +347,6 @@ export const handle = sequence( // https://docs.sentry.io/platforms/javascript/configuration/options/#traces-sample-rate tracesSampleRate: 1.0, // ___PRODUCT_OPTION_END___ performance - // ___PRODUCT_OPTION_START___ logs - - // Enable logs to be sent to Sentry - enableLogs: true, - // ___PRODUCT_OPTION_END___ logs }), sentryHandle() ); diff --git a/platform-includes/getting-started-config/javascript.capacitor.mdx b/platform-includes/getting-started-config/javascript.capacitor.mdx index c373e063e1dc6f..a0092c4b46cc92 100644 --- a/platform-includes/getting-started-config/javascript.capacitor.mdx +++ b/platform-includes/getting-started-config/javascript.capacitor.mdx @@ -17,10 +17,6 @@ Sentry.init( release: "my-project-name@", // Set your dist version, such as "1" dist: "", - // ___PRODUCT_OPTION_START___ logs - // Logs requires @sentry/capacitor 2.0.0 or newer. - enableLogs: true, - // ___PRODUCT_OPTION_END___ logs integrations: [ // ___PRODUCT_OPTION_START___ performance // Registers and configures the Tracing integration, @@ -109,9 +105,6 @@ Sentry.init( release: "my-project-name@", // Set your dist version, such as "1" dist: "", - // ___PRODUCT_OPTION_START___ logs - // Logs requires Angular 14 or newer. - // ___PRODUCT_OPTION_END___ logs integrations: [ // ___PRODUCT_OPTION_START___ performance // Registers and configures the Tracing integration, @@ -197,10 +190,6 @@ Sentry.init( release: "my-project-name@", // Set your dist version, such as "1" dist: "", - // ___PRODUCT_OPTION_START___ logs - // Logs requires @sentry/capacitor 2.0.0 or newer. - enableLogs: true, - // ___PRODUCT_OPTION_END___ logs integrations: [ // ___PRODUCT_OPTION_START___ performance // Registers and configures the Tracing integration, @@ -278,10 +267,6 @@ Sentry.init( release: "my-project-name@", // Set your dist version, such as "1" dist: "", - // ___PRODUCT_OPTION_START___ logs - // Logs requires @sentry/capacitor 2.0.0 or newer. - enableLogs: true, - // ___PRODUCT_OPTION_END___ logs integrations: [ // ___PRODUCT_OPTION_START___ performance // Registers and configures the Tracing integration, @@ -347,10 +332,6 @@ Sentry.init( release: "my-project-name@", // Set your dist version, such as "1" dist: "", - // ___PRODUCT_OPTION_START___ logs - // Logs requires @sentry/capacitor 2.0.0 or newer. - enableLogs: true, - // ___PRODUCT_OPTION_END___ logs integrations: [ // ___PRODUCT_OPTION_START___ performance // Registers and configures the Tracing integration, @@ -418,10 +399,6 @@ Sentry.init({ release: "my-project-name@", // Set your dist version, such as "1" dist: "", - // ___PRODUCT_OPTION_START___ logs - // Logs requires @sentry/capacitor 2.0.0 or newer. - enableLogs: true, - // ___PRODUCT_OPTION_END___ logs integrations: [ // ___PRODUCT_OPTION_START___ performance // Registers and configures the Tracing integration, diff --git a/platform-includes/getting-started-config/javascript.cloudflare.hono.mdx b/platform-includes/getting-started-config/javascript.cloudflare.hono.mdx index ccc7fb497ea363..5218edd21ee81b 100644 --- a/platform-includes/getting-started-config/javascript.cloudflare.hono.mdx +++ b/platform-includes/getting-started-config/javascript.cloudflare.hono.mdx @@ -26,11 +26,6 @@ export default Sentry.withSentry( // userInfo: false, // httpBodies: [], }, - // ___PRODUCT_OPTION_START___ logs - - // Enable logs to be sent to Sentry - enableLogs: true, - // ___PRODUCT_OPTION_END___ logs // ___PRODUCT_OPTION_START___ performance // Set tracesSampleRate to 1.0 to capture 100% of spans for tracing. diff --git a/platform-includes/getting-started-config/javascript.cloudflare.workers.mdx b/platform-includes/getting-started-config/javascript.cloudflare.workers.mdx index 57fb59df686106..734835ed57a527 100644 --- a/platform-includes/getting-started-config/javascript.cloudflare.workers.mdx +++ b/platform-includes/getting-started-config/javascript.cloudflare.workers.mdx @@ -20,11 +20,6 @@ export default Sentry.withSentry( // userInfo: false, // httpBodies: [], }, - // ___PRODUCT_OPTION_START___ logs - - // Enable logs to be sent to Sentry - enableLogs: true, - // ___PRODUCT_OPTION_END___ logs // ___PRODUCT_OPTION_START___ performance // Set tracesSampleRate to 1.0 to capture 100% of spans for tracing. diff --git a/platform-includes/getting-started-config/javascript.hono.mdx b/platform-includes/getting-started-config/javascript.hono.mdx index e40c5a95039c8a..b9d022ac42d656 100644 --- a/platform-includes/getting-started-config/javascript.hono.mdx +++ b/platform-includes/getting-started-config/javascript.hono.mdx @@ -37,11 +37,6 @@ Sentry.init({ // https://docs.sentry.io/platforms/javascript/configuration/options/#profileSessionSampleRate profileSessionSampleRate: 1.0, // ___PRODUCT_OPTION_END___ profiling - // ___PRODUCT_OPTION_START___ logs - - // Enable logs to be sent to Sentry - enableLogs: true, - // ___PRODUCT_OPTION_END___ logs }); ``` @@ -84,10 +79,5 @@ Sentry.init({ // https://docs.sentry.io/platforms/javascript/configuration/options/#profileSessionSampleRate profileSessionSampleRate: 1.0, // ___PRODUCT_OPTION_END___ profiling - // ___PRODUCT_OPTION_START___ logs - - // Enable logs to be sent to Sentry - enableLogs: true, - // ___PRODUCT_OPTION_END___ logs }); ``` diff --git a/platform-includes/getting-started-config/javascript.mdx b/platform-includes/getting-started-config/javascript.mdx index d975e5ad4e8a5e..7f867e82b34a9a 100644 --- a/platform-includes/getting-started-config/javascript.mdx +++ b/platform-includes/getting-started-config/javascript.mdx @@ -40,11 +40,6 @@ Sentry.init({ }), // ___PRODUCT_OPTION_END___ user-feedback ], - // ___PRODUCT_OPTION_START___ logs - - // Enable logs to be sent to Sentry - enableLogs: true, - // ___PRODUCT_OPTION_END___ logs // ___PRODUCT_OPTION_START___ performance // Set tracesSampleRate to 1.0 to capture 100% @@ -104,11 +99,6 @@ Sentry.init({ }), // ___PRODUCT_OPTION_END___ user-feedback ], - // ___PRODUCT_OPTION_START___ logs - - // Enable logs to be sent to Sentry - enableLogs: true, - // ___PRODUCT_OPTION_END___ logs // ___PRODUCT_OPTION_START___ performance // Set tracesSampleRate to 1.0 to capture 100% @@ -170,11 +160,6 @@ Sentry.init({ }), // ___PRODUCT_OPTION_END___ user-feedback ], - // ___PRODUCT_OPTION_START___ logs - - // Enable logs to be sent to Sentry - enableLogs: true, - // ___PRODUCT_OPTION_END___ logs // ___PRODUCT_OPTION_START___ performance // Set tracesSampleRate to 1.0 to capture 100% diff --git a/platform-includes/getting-started-config/javascript.nestjs.mdx b/platform-includes/getting-started-config/javascript.nestjs.mdx index b64884b304aa36..bfa8383f8c1686 100644 --- a/platform-includes/getting-started-config/javascript.nestjs.mdx +++ b/platform-includes/getting-started-config/javascript.nestjs.mdx @@ -29,10 +29,5 @@ Sentry.init({ // https://docs.sentry.io/platforms/javascript/configuration/options/#profileSessionSampleRate profileSessionSampleRate: 1.0, // ___PRODUCT_OPTION_END___ profiling - // ___PRODUCT_OPTION_START___ logs - - // Enable logs to be sent to Sentry - enableLogs: true, - // ___PRODUCT_OPTION_END___ logs }); ``` diff --git a/platform-includes/getting-started-config/javascript.node.mdx b/platform-includes/getting-started-config/javascript.node.mdx index c6f75be731967e..056d5b4093c791 100644 --- a/platform-includes/getting-started-config/javascript.node.mdx +++ b/platform-includes/getting-started-config/javascript.node.mdx @@ -37,11 +37,6 @@ Sentry.init({ // https://docs.sentry.io/platforms/javascript/configuration/options/#profileSessionSampleRate profileSessionSampleRate: 1.0, // ___PRODUCT_OPTION_END___ profiling - // ___PRODUCT_OPTION_START___ logs - - // Enable logs to be sent to Sentry - enableLogs: true, - // ___PRODUCT_OPTION_END___ logs }); ``` @@ -84,10 +79,5 @@ Sentry.init({ // https://docs.sentry.io/platforms/javascript/configuration/options/#profileSessionSampleRate profileSessionSampleRate: 1.0, // ___PRODUCT_OPTION_END___ profiling - // ___PRODUCT_OPTION_START___ logs - - // Enable logs to be sent to Sentry - enableLogs: true, - // ___PRODUCT_OPTION_END___ logs }); ``` diff --git a/platform-includes/getting-started-node/javascript.mdx b/platform-includes/getting-started-node/javascript.mdx index 3be10e71b7ee1e..10a5267087ef73 100644 --- a/platform-includes/getting-started-node/javascript.mdx +++ b/platform-includes/getting-started-node/javascript.mdx @@ -7,7 +7,7 @@ Choose the features you want to configure, and this guide will show you how: diff --git a/platform-includes/logs/options/javascript.mdx b/platform-includes/logs/options/javascript.mdx index 759530e608b30d..bc3c6d914b36f6 100644 --- a/platform-includes/logs/options/javascript.mdx +++ b/platform-includes/logs/options/javascript.mdx @@ -5,7 +5,6 @@ To filter logs, or update them before they are sent to Sentry, you can use the ` ```js Sentry.init({ dsn: "___PUBLIC_DSN___", - enableLogs: true, beforeSendLog: (log) => { if (log.level === "info") { // Filter out all info logs diff --git a/platform-includes/logs/requirements/javascript.mdx b/platform-includes/logs/requirements/javascript.mdx index 15572f2cb1a7e8..89113a96ad00d1 100644 --- a/platform-includes/logs/requirements/javascript.mdx +++ b/platform-includes/logs/requirements/javascript.mdx @@ -1,4 +1,9 @@ -Logs for JavaScript are supported in Sentry JavaScript SDK version `9.41.0` and above. +Logs for JavaScript are supported in Sentry JavaScript SDK version `9.41.0` and above, and are enabled by default in version `10.71.0` and above. + + + On SDK versions below `10.71.0`, logs are opt-in — you must also set + `enableLogs: true` in your `Sentry.init` to send logs. + diff --git a/platform-includes/logs/setup/javascript.cloudflare.mdx b/platform-includes/logs/setup/javascript.cloudflare.mdx index bc802dd3c9c1fc..bfc0572927eb02 100644 --- a/platform-includes/logs/setup/javascript.cloudflare.mdx +++ b/platform-includes/logs/setup/javascript.cloudflare.mdx @@ -1,4 +1,4 @@ -To enable logging, you need to initialize the SDK with the `enableLogs` option set to `true`. +Logs are enabled by default. Initialize the SDK as usual, then use `Sentry.logger` to send logs. ```typescript import * as Sentry from "@sentry/cloudflare"; @@ -6,8 +6,6 @@ import * as Sentry from "@sentry/cloudflare"; export default Sentry.withSentry( (env: Env) => ({ dsn: "___PUBLIC_DSN___", - // Enable logs to be sent to Sentry - enableLogs: true, }), { async fetch(request, env, ctx) { diff --git a/platform-includes/logs/setup/javascript.electron.mdx b/platform-includes/logs/setup/javascript.electron.mdx index 13a0f46e4f8d9b..f44c540924a6a1 100644 --- a/platform-includes/logs/setup/javascript.electron.mdx +++ b/platform-includes/logs/setup/javascript.electron.mdx @@ -1,4 +1,4 @@ -To enable logging, you need to initialize the SDK in the renderer and main processes with the `_experiments.enableLogs` option set to `true`. +Logs are enabled by default. Initialize the SDK in both the main and renderer processes, then use `Sentry.logger` to send logs. First update the main process file. @@ -7,8 +7,6 @@ import * as Sentry from "@sentry/electron/main"; Sentry.init({ dsn: "___PUBLIC_DSN___", - // Enable logs to be sent to Sentry - enableLogs: true, }); ``` @@ -19,7 +17,5 @@ import * as Sentry from "@sentry/electron/renderer"; Sentry.init({ dsn: "___PUBLIC_DSN___", - // Enable logs to be sent to Sentry - enableLogs: true, }); ``` diff --git a/platform-includes/logs/setup/javascript.mdx b/platform-includes/logs/setup/javascript.mdx index 99356aaa29e8cc..9afc0d0d8c6dcb 100644 --- a/platform-includes/logs/setup/javascript.mdx +++ b/platform-includes/logs/setup/javascript.mdx @@ -1,9 +1,7 @@ -To enable logging, you need to initialize the SDK with the `enableLogs` option set to `true`. +Logs are enabled by default. Initialize the SDK as usual, then use `Sentry.logger` to send logs. ```js Sentry.init({ dsn: "___PUBLIC_DSN___", - // Enable logs to be sent to Sentry - enableLogs: true, }); ``` diff --git a/platform-includes/logs/setup/javascript.nextjs.mdx b/platform-includes/logs/setup/javascript.nextjs.mdx index 7ca9c8282fb5c5..d8edec38fa032c 100644 --- a/platform-includes/logs/setup/javascript.nextjs.mdx +++ b/platform-includes/logs/setup/javascript.nextjs.mdx @@ -1,11 +1,10 @@ -To enable logging in Next.js, add `enableLogs: true` to all your Sentry configuration files: +Logs are enabled by default across all your Sentry configuration files. Initialize the SDK as usual, then use `Sentry.logger` to send logs. ```typescript {tabTitle:Client} {mdExpandTabs} {filename:instrumentation-client.ts} import * as Sentry from "@sentry/nextjs"; Sentry.init({ dsn: "___PUBLIC_DSN___", - enableLogs: true, }); ``` @@ -14,7 +13,6 @@ import * as Sentry from "@sentry/nextjs"; Sentry.init({ dsn: "___PUBLIC_DSN___", - enableLogs: true, }); ``` @@ -23,6 +21,5 @@ import * as Sentry from "@sentry/nextjs"; Sentry.init({ dsn: "___PUBLIC_DSN___", - enableLogs: true, }); ```