Skip to content

Commit 26f3150

Browse files
committed
feat(electron): Document structured logging for the Electron SDK
1 parent a22e4d6 commit 26f3150

File tree

6 files changed

+33
-6
lines changed

6 files changed

+33
-6
lines changed

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ description: "Structured logs allow you to send, view and query logs sent from y
55
sidebar_order: 5755
66
notSupported:
77
- javascript.deno
8-
- javascript.electron
98
- javascript.cordova
109
- javascript.capacitor
1110
---

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,11 @@ To set up Sentry Logs, use the links below for supported SDKs. After it's been s
5252
label="Connect"
5353
url="/platforms/javascript/guides/connect/logs/"
5454
/>
55+
- <LinkWithPlatformIcon
56+
platform="javascript.electron"
57+
label="Electron"
58+
url="/platforms/javascript/guides/electron/logs/"
59+
/>
5560
- <LinkWithPlatformIcon
5661
platform="javascript.ember"
5762
label="Ember"
@@ -233,11 +238,6 @@ We're actively working on adding Log functionality to additional SDKs. Check out
233238
label="Elixir"
234239
url="https://github.com/getsentry/sentry-elixir/issues/886"
235240
/>
236-
- <LinkWithPlatformIcon
237-
platform="javascript.electron"
238-
label="Electron"
239-
url="https://github.com/getsentry/sentry-electron/issues/1154"
240-
/>
241241
- <LinkWithPlatformIcon
242242
platform="react-native"
243243
label="React Native"
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<Include name="logs/javascript-console-logging-integration.mdx" />
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Logs for JavaScript are supported in Sentry Electron SDK version [`6.7.0`](https://github.com/getsentry/sentry-electron/releases/tag/6.7.0) and above.
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
To enable logging, you need to initialize the SDK in the renderer and main processes with the `_experiments.enableLogs` option set to `true`.
2+
3+
First update the main process file.
4+
5+
```js
6+
import * as Sentry from "@sentry/electron/main";
7+
8+
Sentry.init({
9+
dsn: "___PUBLIC_DSN___",
10+
// Enable logs to be sent to Sentry
11+
_experiments: { enableLogs: true },
12+
});
13+
```
14+
15+
Then update all your renderer processes.
16+
17+
```js
18+
import * as Sentry from "@sentry/electron/renderer";
19+
20+
Sentry.init({
21+
dsn: "___PUBLIC_DSN___",
22+
// Enable logs to be sent to Sentry
23+
_experiments: { enableLogs: true },
24+
});
25+
```
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<Include name="logs/javascript-usage.mdx" />

0 commit comments

Comments
 (0)