getsentry / getsentry/sentry-react-native

consoleLoggingIntegration should be opt-in per logs spec v2.0.0

Open
#5,985 4 comments 0 reactions 0 assignees View on GitHub
Improvement Logs React-Native
Dominant language
TypeScript
Stars
1.8k
Forks
366
Avg merge
1d 6h
Merged PRs (30d)
94

Description

## Summary

The [logs spec v2.0.0](https://github.com/getsentry/sentry-docs/pull/17233) introduces a requirement that auto-emitting log integrations **MUST** be opt-in:

> Integrations that auto-emit logs MUST be opt-in. The integration MUST NOT emit any logs unless the user explicitly enables it.

Currently, `consoleLoggingIntegration` is automatically added to default integrations when `enableLogs` is truthy (`packages/core/src/js/integrations/default.ts`). Once the spec change to default `enableLogs` to `true` lands upstream, this would silently start capturing all `console.*` calls as Sentry logs for every user — causing unexpected volume and cost.

## Required Changes

- Remove `consoleLoggingIntegration` from default integrations — users should explicitly add it
- Align `enableLogs` default with spec v2.0.0 (`true`) once `@sentry/core` updates

`logEnricherIntegration` can stay as a default since it only enriches existing logs, not auto-emit new ones.

## References

- Spec PR: https://github.com/getsentry/sentry-docs/pull/17233

Contributor guide

Open the contributing guide

Research direction

Start in packages/core/src/js/integrations/default.ts and inspect how consoleLoggingIntegration and logEnricherIntegration are included when enableLogs is truthy. Remove the auto-emitting integration from defaults, align the enableLogs default with the upstream core change, and verify that console logs are captured only when users explicitly add the integration.

Written by the indexing model from the issue text.

Assessment

Tech stack
react-native, typescript
Domain
mobile
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.