Skip to content

feat(core)!: Enable logs by default#22630

Open
nicohrubec wants to merge 5 commits into
developfrom
feat/enable-logs-by-default
Open

feat(core)!: Enable logs by default#22630
nicohrubec wants to merge 5 commits into
developfrom
feat/enable-logs-by-default

Conversation

@nicohrubec

@nicohrubec nicohrubec commented Jul 24, 2026

Copy link
Copy Markdown
Member

This flips the enableLogs client option to default to true so users get Sentry Logs without opting in manually, matching how enableMetrics already behaves. Nothing is captured unless the Sentry.logger API is called or a logging integration is explicitly enabled, and an explicit enableLogs: false still turns it off.

Fixes #20639

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit ce5221b. Configure here.

@github-actions

github-actions Bot commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size % Change Change
@sentry/browser 27.95 kB +0.01% +2 B 🔺
@sentry/browser - with treeshaking flags 26.39 kB +0.01% +2 B 🔺
@sentry/browser (incl. Tracing) 46.41 kB +0.01% +2 B 🔺
@sentry/browser (incl. Tracing + Span Streaming) 48.18 kB +0.01% +2 B 🔺
@sentry/browser (incl. Tracing, Profiling) 51.21 kB +0.01% +2 B 🔺
@sentry/browser (incl. Tracing, Replay) 85.69 kB +0.01% +2 B 🔺
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 75.33 kB +0.01% +2 B 🔺
@sentry/browser (incl. Tracing, Replay with Canvas) 90.4 kB +0.01% +1 B 🔺
@sentry/browser (incl. Tracing, Replay, Feedback) 103.06 kB +0.01% +3 B 🔺
@sentry/browser (incl. Feedback) 45.13 kB +0.01% +3 B 🔺
@sentry/browser (incl. sendFeedback) 32.74 kB +0.01% +1 B 🔺
@sentry/browser (incl. FeedbackAsync) 37.81 kB +0.01% +2 B 🔺
@sentry/browser (incl. Metrics) 29.04 kB +0.01% +2 B 🔺
@sentry/browser (incl. Logs) 29.26 kB +0.01% +2 B 🔺
@sentry/browser (incl. Metrics & Logs) 29.97 kB +0.01% +1 B 🔺
@sentry/react 29.75 kB +0.01% +2 B 🔺
@sentry/react (incl. Tracing) 48.72 kB +0.01% +4 B 🔺
@sentry/vue 33.38 kB +0.01% +1 B 🔺
@sentry/vue (incl. Tracing) 48.4 kB +0.01% +2 B 🔺
@sentry/svelte 27.97 kB +0.01% +2 B 🔺
CDN Bundle 30.29 kB +0.01% +2 B 🔺
CDN Bundle (incl. Tracing) 48.26 kB +0.01% +3 B 🔺
CDN Bundle (incl. Logs, Metrics) 31.85 kB +0.01% +2 B 🔺
CDN Bundle (incl. Tracing, Logs, Metrics) 49.58 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) 71.13 kB +0.01% +2 B 🔺
CDN Bundle (incl. Tracing, Replay) 85.83 kB +0.01% +4 B 🔺
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 87.14 kB +0.01% +1 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback) 91.61 kB +0.01% +3 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 92.89 kB +0.01% +1 B 🔺
CDN Bundle - uncompressed 90.15 kB +0.01% +4 B 🔺
CDN Bundle (incl. Tracing) - uncompressed 145.22 kB +0.01% +4 B 🔺
CDN Bundle (incl. Logs, Metrics) - uncompressed 94.86 kB +0.01% +4 B 🔺
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 149.2 kB +0.01% +4 B 🔺
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 219.62 kB +0.01% +4 B 🔺
CDN Bundle (incl. Tracing, Replay) - uncompressed 264.46 kB +0.01% +4 B 🔺
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 268.43 kB +0.01% +4 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 278.16 kB +0.01% +4 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 282.12 kB +0.01% +4 B 🔺
@sentry/nextjs (client) 51.24 kB +0.01% +2 B 🔺
@sentry/sveltekit (client) 46.84 kB +0.01% +1 B 🔺
@sentry/core/server 80.05 kB +0.01% +2 B 🔺
@sentry/core/browser 52.01 kB +0.01% +2 B 🔺
@sentry/node 123.14 kB - -
@sentry/node (incl. diagnostics channel injection) 167.14 kB - -
@sentry/node/import (ESM hook with diagnostics-channel injection) 166 B - -
@sentry/node - without tracing 73.31 kB - -
@sentry/aws-serverless 82.82 kB +0.01% +2 B 🔺
@sentry/cloudflare (withSentry) - minified 197.06 kB +0.01% +4 B 🔺
@sentry/cloudflare (withSentry) 484.74 kB +0.01% +8 B 🔺

View base workflow run

nicohrubec and others added 3 commits July 24, 2026 16:07
Flip the `enableLogs` client option to default to `true`, mirroring `enableMetrics`.
No logs are emitted unless the logger API is called or a logging integration is
explicitly enabled, since no default integration captures logs.

Fixes #20639

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The client constructor backfills `enableLogs` onto its options, so the strict
`getOptions()` equality check now needs the resolved default.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Flush the log buffer before capturing the sentinel error so a leaked log
envelope arrives first and fails the ordered `event` expectation. Previously
the error was sent first and the runner could complete before a stray log
arrived, letting a broken disable path pass.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@nicohrubec
nicohrubec force-pushed the feat/enable-logs-by-default branch from 5a51b06 to 721edd9 Compare July 24, 2026 14:08
nicohrubec and others added 2 commits July 24, 2026 16:11
The constructor already backfills `enableLogs` from `_experiments.enableLogs`,
so re-reading `_experiments` in the capture guard was dead code. Reduce it to a
plain destructure default, matching the original shape.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The default has now been flipped, so the "or change default value" branch of the
TODO is done. Narrow it to removing the deprecated experimental flag, matching
the adjacent enableMetrics TODO.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@nicohrubec
nicohrubec marked this pull request as ready for review July 24, 2026 14:47
@nicohrubec
nicohrubec requested review from a team as code owners July 24, 2026 14:47
@nicohrubec
nicohrubec requested review from JPeer264 and isaacs and removed request for a team July 24, 2026 14:47
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.

Enable logging by default [Javascript]

1 participant