Skip to content

Commit 300b963

Browse files
authored
docs(react-native): Console logging integration docs change (#15900)
## DESCRIBE YOUR PR Because the Console Logging Integration is now enabled by default we have to change the docs on the subject. ## IS YOUR CHANGE URGENT? Help us prioritize incoming PRs by letting us know when the change needs to go live. - [ ] Urgent deadline (GA date, etc.): <!-- ENTER DATE HERE --> - [ ] Other deadline: <!-- ENTER DATE HERE --> - [x] None: Not urgent, can wait up to 1 week+
1 parent a53e8c0 commit 300b963

File tree

2 files changed

+34
-1
lines changed

2 files changed

+34
-1
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
### Console Logging Integration
2+
3+
Console Logging integration is enabled by default which means calls to the `console` API will be captured as logs in Sentry. By default the integration instruments `console.debug`, `console.info`, `console.warn`, `console.error`, `console.log`, `console.trace`, and `console.assert`.
4+
5+
#### Disabling Console Logging Integration
6+
7+
To disable the integration, filter it out from the integrations array:
8+
9+
```js
10+
Sentry.init({
11+
...,
12+
integrations(integrations) {
13+
return integrations.filter(i => i.name !== 'ConsoleLogs');
14+
},
15+
...
16+
})
17+
```
18+
19+
You can also filter out the automatically captured logs in `beforeSendLog`:
20+
21+
```js
22+
Sentry.init({
23+
...,
24+
beforeSendLog: (log) => {
25+
if (log.attributes?.['sentry.origin'] === 'auto.log.console') {
26+
return null;
27+
}
28+
return log;
29+
},
30+
...
31+
})
32+
33+
```
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
<Include name="logs/javascript-console-logging-integration.mdx" />
1+
<Include name="logs/react-native-console-logging-integration.mdx" />
22

33
<Include name="logs/javascript-consola-integration.mdx" />

0 commit comments

Comments
 (0)