Skip to content
Merged
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
18 changes: 8 additions & 10 deletions platform-includes/logs/options/javascript.mdx
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
#### beforeSendLog

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

```js
Sentry.init({
dsn: "___PUBLIC_DSN___",
_experiments: {
enableLogs: true,
beforeSendLog: (log) => {
if (log.level === "info") {
// Filter out all info logs
return null;
}
enableLogs: true,
beforeSendLog: (log) => {
if (log.level === "info") {
// Filter out all info logs
return null;
}

return log;
},
return log;
},
});
```
Expand Down
4 changes: 2 additions & 2 deletions platform-includes/logs/setup/javascript.cloudflare.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
To enable logging, you need to initialize the SDK with the `_experiments.enableLogs` option set to `true`.
To enable logging, you need to initialize the SDK with the `enableLogs` option set to `true`.

```typescript
import * as Sentry from "@sentry/cloudflare";
Expand All @@ -7,7 +7,7 @@ export default Sentry.withSentry(
(env: Env) => ({
dsn: "___PUBLIC_DSN___",
// Enable logs to be sent to Sentry
_experiments: { enableLogs: true },
enableLogs: true,
}),
{
async fetch(request, env, ctx) {
Expand Down
4 changes: 2 additions & 2 deletions platform-includes/logs/setup/javascript.mdx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
To enable logging, you need to initialize the SDK with the `_experiments.enableLogs` option set to `true`.
To enable logging, you need to initialize the SDK with the `enableLogs` option set to `true`.

```js
Sentry.init({
dsn: "___PUBLIC_DSN___",
// Enable logs to be sent to Sentry
_experiments: { enableLogs: true },
enableLogs: true,
});
```