Skip to content

Commit 01dc710

Browse files
authored
feat(js): switch option to use non-experimental option for logs (#14449)
<!-- Use this checklist to make sure your PR is ready for merge. You may delete any sections you don't need. --> ## DESCRIBE YOUR PR Documents getsentry/sentry-javascript#17092 ## 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) ## LEGAL BOILERPLATE <!-- Sentry employees and contractors can delete or ignore this section. --> Look, I get it. The entity doing business as "Sentry" was incorporated in the State of Delaware in 2015 as Functional Software, Inc. and is gonna need some rights from me in order to utilize my contributions in this here PR. So here's the deal: I retain all rights, title and interest in and to my contributions, and by keeping this boilerplate intact I confirm that Sentry can use, modify, copy, and redistribute my contributions, under Sentry's choice of terms. ## EXTRA RESOURCES - [Sentry Docs contributor guide](https://docs.sentry.io/contributing/)
1 parent 32d9103 commit 01dc710

File tree

3 files changed

+12
-14
lines changed

3 files changed

+12
-14
lines changed

platform-includes/logs/options/javascript.mdx

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,18 @@
11
#### beforeSendLog
22

3-
To filter logs, or update them before they are sent to Sentry, you can use the `_experiments.beforeSendLog` option.
3+
To filter logs, or update them before they are sent to Sentry, you can use the `beforeSendLog` option.
44

55
```js
66
Sentry.init({
77
dsn: "___PUBLIC_DSN___",
8-
_experiments: {
9-
enableLogs: true,
10-
beforeSendLog: (log) => {
11-
if (log.level === "info") {
12-
// Filter out all info logs
13-
return null;
14-
}
8+
enableLogs: true,
9+
beforeSendLog: (log) => {
10+
if (log.level === "info") {
11+
// Filter out all info logs
12+
return null;
13+
}
1514

16-
return log;
17-
},
15+
return log;
1816
},
1917
});
2018
```

platform-includes/logs/setup/javascript.cloudflare.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
To enable logging, you need to initialize the SDK with the `_experiments.enableLogs` option set to `true`.
1+
To enable logging, you need to initialize the SDK with the `enableLogs` option set to `true`.
22

33
```typescript
44
import * as Sentry from "@sentry/cloudflare";
@@ -7,7 +7,7 @@ export default Sentry.withSentry(
77
(env: Env) => ({
88
dsn: "___PUBLIC_DSN___",
99
// Enable logs to be sent to Sentry
10-
_experiments: { enableLogs: true },
10+
enableLogs: true,
1111
}),
1212
{
1313
async fetch(request, env, ctx) {
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
To enable logging, you need to initialize the SDK with the `_experiments.enableLogs` option set to `true`.
1+
To enable logging, you need to initialize the SDK with the `enableLogs` option set to `true`.
22

33
```js
44
Sentry.init({
55
dsn: "___PUBLIC_DSN___",
66
// Enable logs to be sent to Sentry
7-
_experiments: { enableLogs: true },
7+
enableLogs: true,
88
});
99
```

0 commit comments

Comments
 (0)