Skip to content

chore: Deprecate the enable_logs option - #1299

Merged
szokeasaurusrex merged 2 commits into
masterfrom
szokeasaurusrex/enable-logs-deprecation
Aug 26, 2026
Merged

szokeasaurusrex merged 2 commits into
masterfrom
szokeasaurusrex/enable-logs-deprecation

Conversation

@szokeasaurusrex

@szokeasaurusrex szokeasaurusrex commented Aug 13, 2026 •

Copy link
Copy Markdown
Member

Disabling log sending via ClientOptions::enable_logs is somewhat of a footgun, as this flag can prevent all Sentry logs from being sent. This change deprecates the option and restricts its effect: setting enable_logs to false now only disables automatic log capture by the log-capturing integrations (currently tracing and log, both with the logs feature). Logs captured manually via the logging APIs we provide (Hub::capture_log and the logger_* macros) are always sent, regardless of the option's value.

We also deprecate the option, as we will remove it in the next breaking release. The migration path is to configure the relevant integration via its own options to not send logs; each integration's documentation describes how to do this.

Resolves #1297
Resolves RUST-274

@szokeasaurusrex
szokeasaurusrex marked this pull request as ready for review August 13, 2026 11:21
@szokeasaurusrex
szokeasaurusrex requested a review from a team as a code owner August 13, 2026 11:21
@linear-code

linear-code Bot commented Aug 13, 2026

Copy link
Copy Markdown

RUST-274

@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 c98feda. Configure here.

Comment thread sentry-core/src/client/mod.rs Resolved
Comment thread sentry-core/src/client/mod.rs Resolved
Comment thread sentry-core/src/clientoptions.rs Resolved
Comment thread sentry-core/src/client/mod.rs Resolved
Comment thread sentry-core/src/clientoptions.rs Resolved
@szokeasaurusrex
szokeasaurusrex force-pushed the szokeasaurusrex/enable-logs-deprecation branch from 1d9ba55 to fd719e1 Compare August 13, 2026 13:53
@szokeasaurusrex
szokeasaurusrex force-pushed the szokeasaurusrex/enable-logs-deprecation branch from fd719e1 to 88da24f Compare August 25, 2026 07:32
@szokeasaurusrex
szokeasaurusrex changed the base branch from master to szokeasaurusrex/enable-metrics-deprecation August 25, 2026 07:32
@szokeasaurusrex
szokeasaurusrex force-pushed the szokeasaurusrex/enable-logs-deprecation branch from 88da24f to d1525b8 Compare August 25, 2026 08:03
@szokeasaurusrex
szokeasaurusrex marked this pull request as draft August 25, 2026 08:15
@szokeasaurusrex
szokeasaurusrex marked this pull request as ready for review August 25, 2026 18:18
@szokeasaurusrex

Copy link
Copy Markdown
Member Author

@giortzisg would appreciate re-review, as I made it now so enable_logs is not fully a no-op. Rather, it only gates integration-captured logs, not manually-captured ones

Base automatically changed from szokeasaurusrex/enable-metrics-deprecation to master August 25, 2026 18:26
Providing the ability to disable sending logs is somewhat of a footgun, as this flag can prevent all Sentry logs from being sent, so this change turns that option into a no-op, ensuring logs are always enabled.

Logs are only sent when users explicitly record them with the logging APIs we provide or when one of the integrations that captures logs (currently `tracing`, `log`, or `slog`) are enabled. Users who do not want logs can either stop using the logging APIs, disable the integrations which capture logs, or adjust said integrations' configurations.

Resolves [#1297](#1297)
Resolves [RUST-274](https://linear.app/getsentry/issue/RUST-274/deprecate-and-no-op-ify-enable-logs)
@szokeasaurusrex
szokeasaurusrex merged commit 9467e7b into master Aug 26, 2026
31 checks passed
@szokeasaurusrex
szokeasaurusrex deleted the szokeasaurusrex/enable-logs-deprecation branch August 26, 2026 09:32
szokeasaurusrex added a commit to getsentry/sentry-docs that referenced this pull request Aug 26, 2026
getsentry/sentry-rust#1299 deprecates the Rust
SDK's `enable_logs` option.

This change removes the last-remaining reference to `enable_logs` in the
Rust SDK's docs.

Relates to getsentry/sentry-rust#1297
Relates to
[RUST-274](https://linear.app/getsentry/issue/RUST-274/deprecate-and-no-op-ify-enable-logs)
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.

Deprecate and no-op-ify enable_logs

2 participants