From 7c6ab063d362d4394e2ced8f145010612894cd3f Mon Sep 17 00:00:00 2001 From: Nicolas Hrubec Date: Wed, 29 Jul 2026 11:58:23 +0200 Subject: [PATCH 1/3] feat(core)!: Remove deprecated `_experiments.enableLogs` option Removes the deprecated `_experiments.enableLogs` option, which has been superseded by the top-level `enableLogs` flag. Drops the type field, the constructor backfill, the now-redundant experimental-path tests, and the precedence override in the browser integration fixture, and documents the removal in `MIGRATION.md`. Fixes #22634 Co-Authored-By: Claude Opus 4.8 (1M context) --- MIGRATION.md | 16 ++++++++++++++++ .../suites/public-api/logger/integration/init.js | 5 ----- packages/core/src/client.ts | 5 +---- packages/core/src/types/options.ts | 8 -------- packages/core/test/lib/client.test.ts | 16 ---------------- 5 files changed, 17 insertions(+), 33 deletions(-) diff --git a/MIGRATION.md b/MIGRATION.md index 129377ba8587..085f74f24c58 100644 --- a/MIGRATION.md +++ b/MIGRATION.md @@ -326,6 +326,22 @@ Sentry.init({ }); ``` +- The `_experiments.enableLogs` option was removed, use the top-level `enableLogs` option instead. + +```js +// before +Sentry.init({ + _experiments: { + enableLogs: true, + }, +}); + +// after +Sentry.init({ + enableLogs: true, +}); +``` + - The deprecated `trackFetchStreamPerformance` option of `browserTracingIntegration` was removed. To track the duration of streamed fetch response bodies, add `fetchStreamPerformanceIntegration()` to your `integrations` array instead. ```js diff --git a/dev-packages/browser-integration-tests/suites/public-api/logger/integration/init.js b/dev-packages/browser-integration-tests/suites/public-api/logger/integration/init.js index cb43cfb52cbb..010c9af592d1 100644 --- a/dev-packages/browser-integration-tests/suites/public-api/logger/integration/init.js +++ b/dev-packages/browser-integration-tests/suites/public-api/logger/integration/init.js @@ -6,10 +6,5 @@ Sentry.init({ traceLifecycle: 'static', dsn: 'https://public@dsn.ingest.sentry.io/1337', enableLogs: true, - // Purposefully specifying the experimental flag here - // to ensure the top level option is used instead. - _experiments: { - enableLogs: false, - }, integrations: [Sentry.consoleLoggingIntegration()], }); diff --git a/packages/core/src/client.ts b/packages/core/src/client.ts index 2b3338bfe7f2..a5eb7d45cfc5 100644 --- a/packages/core/src/client.ts +++ b/packages/core/src/client.ts @@ -264,10 +264,7 @@ export abstract class Client { }); } - // Backfill enableLogs option from _experiments.enableLogs - // todo(v11): Remove the experimental flag - // eslint-disable-next-line typescript/no-deprecated - this._options.enableLogs = this._options.enableLogs ?? this._options._experiments?.enableLogs ?? true; + this._options.enableLogs = this._options.enableLogs ?? true; // Setup log flushing with weight and timeout tracking if (this._options.enableLogs) { diff --git a/packages/core/src/types/options.ts b/packages/core/src/types/options.ts index 51ae35fb7ff0..e5f938082509 100644 --- a/packages/core/src/types/options.ts +++ b/packages/core/src/types/options.ts @@ -449,14 +449,6 @@ export interface ClientOptions Metric | null; - - /** - * Determines if logs support should be enabled. - * - * @default false - * @deprecated Use the top level `enableLogs` option instead. - */ - enableLogs?: boolean; }; /** diff --git a/packages/core/test/lib/client.test.ts b/packages/core/test/lib/client.test.ts index ddc992476533..ccfbc1971fad 100644 --- a/packages/core/test/lib/client.test.ts +++ b/packages/core/test/lib/client.test.ts @@ -2954,22 +2954,6 @@ describe('Client', () => { const client = new TestClient(options); expect(client.getOptions().enableLogs).toBe(false); }); - - it('can be disabled via the experimental option', () => { - const options = getDefaultTestClientOptions({ dsn: PUBLIC_DSN, _experiments: { enableLogs: false } }); - const client = new TestClient(options); - expect(client.getOptions().enableLogs).toBe(false); - }); - - test('top-level option takes precedence over experimental option', () => { - const options = getDefaultTestClientOptions({ - dsn: PUBLIC_DSN, - enableLogs: false, - _experiments: { enableLogs: true }, - }); - const client = new TestClient(options); - expect(client.getOptions().enableLogs).toBe(false); - }); }); describe('log weight-based flushing', () => { From 9907333636ad6335bfb80f2528502423390812e6 Mon Sep 17 00:00:00 2001 From: Nicolas Hrubec Date: Wed, 29 Jul 2026 12:14:28 +0200 Subject: [PATCH 2/3] docs: Clarify enableLogs migration example Logs are now enabled by default, so the migration example now shows the option can be omitted rather than set to `true`. Co-Authored-By: Claude Opus 4.8 (1M context) --- MIGRATION.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/MIGRATION.md b/MIGRATION.md index 085f74f24c58..875ece095f68 100644 --- a/MIGRATION.md +++ b/MIGRATION.md @@ -326,7 +326,7 @@ Sentry.init({ }); ``` -- The `_experiments.enableLogs` option was removed, use the top-level `enableLogs` option instead. +- The `_experiments.enableLogs` option was removed. Logs are now enabled by default, so if you were opting in via `_experiments.enableLogs: true` you can simply omit the option. Use the top-level `enableLogs: false` to opt out. ```js // before @@ -336,9 +336,12 @@ Sentry.init({ }, }); -// after +// after: logs are enabled by default, no option needed +Sentry.init({}); + +// or, to opt out Sentry.init({ - enableLogs: true, + enableLogs: false, }); ``` From ea9dca71bfd863e143bdba5b57c8c486670a75dc Mon Sep 17 00:00:00 2001 From: Nicolas Hrubec Date: Wed, 29 Jul 2026 13:40:17 +0200 Subject: [PATCH 3/3] Update packages/core/src/client.ts Co-authored-by: Martin Sonnberger --- packages/core/src/client.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/core/src/client.ts b/packages/core/src/client.ts index a5eb7d45cfc5..6f74f18e1d28 100644 --- a/packages/core/src/client.ts +++ b/packages/core/src/client.ts @@ -264,7 +264,7 @@ export abstract class Client { }); } - this._options.enableLogs = this._options.enableLogs ?? true; + this._options.enableLogs ??= true; // Setup log flushing with weight and timeout tracking if (this._options.enableLogs) {