Skip to content

feat(capacitor) logs documentaiton #14274

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion docs/platforms/javascript/common/logs/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ sidebar_order: 5755
notSupported:
- javascript.deno
- javascript.cordova
- javascript.capacitor
---

<PlatformContent includePath="llm-rules-logs" />
Expand Down
43 changes: 43 additions & 0 deletions docs/platforms/javascript/guides/capacitor/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,16 @@ Sentry.init(
release: "my-project-name@<release-name>",
// Set your dist version, such as "1"
dist: "<dist>",
// ___PRODUCT_OPTION_START___ logs
// Logs requires @sentry/capacitor 2.0.0 or newer.
_experiments: {
enableLogs: true,
beforeSendLog: (log) => {
// Add custom filters to logs.
return log;
}
},
// ___PRODUCT_OPTION_END___ logs
integrations: [
// ___PRODUCT_OPTION_START___ performance
// Registers and configures the Tracing integration,
Expand Down Expand Up @@ -203,6 +213,9 @@ Sentry.init(
release: "my-project-name@<release-name>",
// Set your dist version, such as "1"
dist: "<dist>",
// ___PRODUCT_OPTION_START___ logs
// Logs requires Angular 14 or newer.
// ___PRODUCT_OPTION_END___ logs
integrations: [
// ___PRODUCT_OPTION_START___ performance
// Registers and configures the Tracing integration,
Expand Down Expand Up @@ -285,6 +298,16 @@ Sentry.init(
release: "my-project-name@<release-name>",
// Set your dist version, such as "1"
dist: "<dist>",
// ___PRODUCT_OPTION_START___ logs
// Logs requires @sentry/capacitor 2.0.0 or newer.
_experiments: {
enableLogs: true,
beforeSendLog: (log) => {
// Add custom filters to logs.
return log;
}
},
// ___PRODUCT_OPTION_END___ logs
integrations: [
// ___PRODUCT_OPTION_START___ performance
// Registers and configures the Tracing integration,
Expand Down Expand Up @@ -351,6 +374,16 @@ Sentry.init(
release: "my-project-name@<release-name>",
// Set your dist version, such as "1"
dist: "<dist>",
// ___PRODUCT_OPTION_START___ logs
// Logs requires @sentry/capacitor 2.0.0 or newer.
_experiments: {
enableLogs: true,
beforeSendLog: (log) => {
// Add custom filters to logs.
return log;
}
},
// ___PRODUCT_OPTION_END___ logs
integrations: [
// ___PRODUCT_OPTION_START___ performance
// Registers and configures the Tracing integration,
Expand Down Expand Up @@ -414,6 +447,16 @@ Sentry.init(
release: "my-project-name@<release-name>",
// Set your dist version, such as "1"
dist: "<dist>",
// ___PRODUCT_OPTION_START___ logs
// Logs requires @sentry/capacitor 2.0.0 or newer.
_experiments: {
enableLogs: true,
beforeSendLog: (log) => {
// Add custom filters to logs.
return log;
}
},
// ___PRODUCT_OPTION_END___ logs
integrations: [
// ___PRODUCT_OPTION_START___ performance
// Registers and configures the Tracing integration,
Expand Down
5 changes: 5 additions & 0 deletions docs/product/explore/logs/getting-started/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,11 @@ To set up Sentry Logs, use the links below for supported SDKs. After it's been s
label="Android"
url="/platforms/android/logs/"
/>
- <LinkWithPlatformIcon
platform="capacitor"
label="Capacitor"
url="/platforms/javascript/guides/capacitor/logs/"
/>
- <LinkWithPlatformIcon
platform="dart.flutter"
label="Flutter"
Expand Down
11 changes: 11 additions & 0 deletions platform-includes/logs/requirements/javascript.capacitor.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
Logs for JavaScript are supported in Sentry Capacitor SDK version `2.0.0` and above.

<PlatformSection supported={["javascript"]}>

<Alert level="warning">

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).

</Alert>

</PlatformSection>