Skip to content

Commit 181122b

Browse files
feat(capacitor) logs documentaiton (#14274)
## DESCRIBE YOUR PR *Tell us what you're changing and why. If your PR **resolves an issue**, please link it so it closes automatically.* On version 2.0.0, we introduced logging support for Capacitor This PR adds all the changes and how to use logging on React Native. ## 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+ ## SLA - Teamwork makes the dream work, so please add a reviewer to your PRs. - Please give the docs team up to 1 week to review your PR unless you've added an urgent due date to it. Thanks in advance for your help! ## PRE-MERGE CHECKLIST *Make sure you've checked the following before merging your changes:* - [ ] Checked Vercel preview for correctness, including links - [ ] PR was reviewed and approved by any necessary SMEs (subject matter experts) - [ ] PR was reviewed and approved by a member of the [Sentry docs team](https://github.com/orgs/getsentry/teams/docs) ## EXTRA RESOURCES - [Sentry Docs contributor guide](https://docs.sentry.io/contributing/)
1 parent c2b929d commit 181122b

File tree

4 files changed

+59
-1
lines changed

4 files changed

+59
-1
lines changed

docs/platforms/javascript/common/logs/index.mdx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ sidebar_order: 5755
66
notSupported:
77
- javascript.deno
88
- javascript.cordova
9-
- javascript.capacitor
109
---
1110

1211
<PlatformContent includePath="llm-rules-logs" />

docs/platforms/javascript/guides/capacitor/index.mdx

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,16 @@ Sentry.init(
118118
release: "my-project-name@<release-name>",
119119
// Set your dist version, such as "1"
120120
dist: "<dist>",
121+
// ___PRODUCT_OPTION_START___ logs
122+
// Logs requires @sentry/capacitor 2.0.0 or newer.
123+
_experiments: {
124+
enableLogs: true,
125+
beforeSendLog: (log) => {
126+
// Add custom filters to logs.
127+
return log;
128+
}
129+
},
130+
// ___PRODUCT_OPTION_END___ logs
121131
integrations: [
122132
// ___PRODUCT_OPTION_START___ performance
123133
// Registers and configures the Tracing integration,
@@ -203,6 +213,9 @@ Sentry.init(
203213
release: "my-project-name@<release-name>",
204214
// Set your dist version, such as "1"
205215
dist: "<dist>",
216+
// ___PRODUCT_OPTION_START___ logs
217+
// Logs requires Angular 14 or newer.
218+
// ___PRODUCT_OPTION_END___ logs
206219
integrations: [
207220
// ___PRODUCT_OPTION_START___ performance
208221
// Registers and configures the Tracing integration,
@@ -285,6 +298,16 @@ Sentry.init(
285298
release: "my-project-name@<release-name>",
286299
// Set your dist version, such as "1"
287300
dist: "<dist>",
301+
// ___PRODUCT_OPTION_START___ logs
302+
// Logs requires @sentry/capacitor 2.0.0 or newer.
303+
_experiments: {
304+
enableLogs: true,
305+
beforeSendLog: (log) => {
306+
// Add custom filters to logs.
307+
return log;
308+
}
309+
},
310+
// ___PRODUCT_OPTION_END___ logs
288311
integrations: [
289312
// ___PRODUCT_OPTION_START___ performance
290313
// Registers and configures the Tracing integration,
@@ -351,6 +374,16 @@ Sentry.init(
351374
release: "my-project-name@<release-name>",
352375
// Set your dist version, such as "1"
353376
dist: "<dist>",
377+
// ___PRODUCT_OPTION_START___ logs
378+
// Logs requires @sentry/capacitor 2.0.0 or newer.
379+
_experiments: {
380+
enableLogs: true,
381+
beforeSendLog: (log) => {
382+
// Add custom filters to logs.
383+
return log;
384+
}
385+
},
386+
// ___PRODUCT_OPTION_END___ logs
354387
integrations: [
355388
// ___PRODUCT_OPTION_START___ performance
356389
// Registers and configures the Tracing integration,
@@ -414,6 +447,16 @@ Sentry.init(
414447
release: "my-project-name@<release-name>",
415448
// Set your dist version, such as "1"
416449
dist: "<dist>",
450+
// ___PRODUCT_OPTION_START___ logs
451+
// Logs requires @sentry/capacitor 2.0.0 or newer.
452+
_experiments: {
453+
enableLogs: true,
454+
beforeSendLog: (log) => {
455+
// Add custom filters to logs.
456+
return log;
457+
}
458+
},
459+
// ___PRODUCT_OPTION_END___ logs
417460
integrations: [
418461
// ___PRODUCT_OPTION_START___ performance
419462
// Registers and configures the Tracing integration,

docs/product/explore/logs/getting-started/index.mdx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,11 @@ To set up Sentry Logs, use the links below for supported SDKs. After it's been s
193193
label="Android"
194194
url="/platforms/android/logs/"
195195
/>
196+
- <LinkWithPlatformIcon
197+
platform="capacitor"
198+
label="Capacitor"
199+
url="/platforms/javascript/guides/capacitor/logs/"
200+
/>
196201
- <LinkWithPlatformIcon
197202
platform="dart.flutter"
198203
label="Flutter"
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
Logs for JavaScript are supported in Sentry Capacitor SDK version `2.0.0` and above.
2+
3+
<PlatformSection supported={["javascript"]}>
4+
5+
<Alert level="warning">
6+
7+
Logging is not supported in the [loader or CDN script](/platforms/javascript/install/loader/) for browser JavaScript. We recommend installing the SDK via [NPM](/platforms/javascript/install/npm/) to use logging. We are tracking support for the loader and CDN script in [this GitHub issue](https://github.com/getsentry/sentry-javascript/issues/16314).
8+
9+
</Alert>
10+
11+
</PlatformSection>

0 commit comments

Comments
 (0)