Skip to content

Commit 48b9f13

Browse files
committed
Add logs beta configuration to JavaScript platform documentation
1 parent 7e020de commit 48b9f13

File tree

7 files changed

+189
-8
lines changed

7 files changed

+189
-8
lines changed

JAVASCRIPT_LOGS_BETA_FIXES.md

Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
# JavaScript Logs Beta Configuration Fixes
2+
3+
This document summarizes all the fixes made to JavaScript platform documentation to ensure that when users select the "Logs Beta" checkbox, the corresponding logs setup code appears in the getting started configuration.
4+
5+
## Issue Fixed
6+
7+
The user reported that when selecting the "Logs Beta" checkbox for JavaScript SDKs, they didn't see the logs snippet being added to the getting started code. This was because while the logs configuration was added to the shared platform-includes files, many individual JavaScript platform guides were missing:
8+
9+
1. `'logs-beta'` in their OnboardingOptionButtons options arrays
10+
2. The logs configuration code with proper product option markers
11+
12+
## Solution
13+
14+
Added `'logs-beta'` to OnboardingOptionButtons and the corresponding logs configuration (`_experiments: { enableLogs: true }`) with product option markers to all JavaScript platform documentation files.
15+
16+
## Files Updated
17+
18+
### 1. JavaScript Framework Guides
19+
20+
#### Vue.js
21+
- **File**: `docs/platforms/javascript/guides/vue/index.mdx`
22+
- **Changes**:
23+
- Added `'logs-beta'` to OnboardingOptionButtons
24+
- Added logs config to both Vue 3 and Vue 2 code blocks
25+
- **Configuration**: `_experiments: { enableLogs: true }`
26+
27+
#### Svelte
28+
- **File**: `docs/platforms/javascript/guides/svelte/index.mdx`
29+
- **Changes**:
30+
- Added `'logs-beta'` to OnboardingOptionButtons
31+
- Added logs config to both Svelte v5+ and v3-v4 code blocks
32+
- **Configuration**: `_experiments: { enableLogs: true }`
33+
34+
#### Astro
35+
- **File**: `docs/platforms/javascript/guides/astro/index.mdx`
36+
- **Changes**:
37+
- Added `'logs-beta'` to OnboardingOptionButtons
38+
- Added logs config to both client-side and server-side setup blocks
39+
- **Configuration**: `_experiments: { enableLogs: true }`
40+
41+
#### Solid
42+
- **File**: `docs/platforms/javascript/guides/solid/index.mdx`
43+
- **Changes**:
44+
- Added `'logs-beta'` to OnboardingOptionButtons
45+
- Added logs config to the main configuration block
46+
- **Configuration**: `_experiments: { enableLogs: true }`
47+
48+
#### Capacitor
49+
- **File**: `docs/platforms/javascript/guides/capacitor/index.mdx`
50+
- **Changes**:
51+
- Added `'logs-beta'` to OnboardingOptionButtons
52+
- Added logs config to all framework variations:
53+
- Angular 14+
54+
- Angular 12-13
55+
- React
56+
- Vue
57+
- Nuxt
58+
- **Configuration**: `_experiments: { enableLogs: true }`
59+
60+
### 2. Main JavaScript Platform Documentation
61+
62+
#### JavaScript Common
63+
- **File**: `docs/platforms/javascript/common/index.mdx`
64+
- **Changes**: Added `'logs-beta'` to all OnboardingOptionButtons instances:
65+
- Browser platforms: `["error-monitoring", "performance", "session-replay", "user-feedback", "logs-beta"]`
66+
- Server platforms (non-Bun): `["error-monitoring", "performance", "profiling", "logs-beta"]`
67+
- Bun platform: `["error-monitoring", "performance", "logs-beta"]`
68+
69+
### 3. Previously Updated Files (Initial Implementation)
70+
71+
These were already updated in the initial implementation:
72+
- `docs/platforms/javascript/guides/react/index.mdx`
73+
- `docs/platforms/javascript/guides/nextjs/manual-setup.mdx`
74+
- `platform-includes/getting-started-config/javascript.mdx`
75+
76+
### 4. Platform-Includes Configuration Files (Fixed in Previous Session)
77+
78+
These shared configuration files were updated to include the logs-beta configuration:
79+
- `platform-includes/getting-started-config/javascript.node.mdx`
80+
- `platform-includes/getting-started-config/javascript.aws-lambda.mdx`
81+
- `platform-includes/getting-started-config/javascript.gcp-functions.mdx`
82+
- `platform-includes/getting-started-config/javascript.cloudflare.workers.mdx`
83+
- `platform-includes/getting-started-config/javascript.nestjs.mdx`
84+
85+
### 5. Framework Guides Using Shared Content
86+
87+
These frameworks use shared content includes (getting-started-node) and inherit the logs configuration automatically:
88+
- Express (`docs/platforms/javascript/guides/express/index.mdx`)
89+
- Koa (`docs/platforms/javascript/guides/koa/index.mdx`)
90+
- Node.js (`docs/platforms/javascript/guides/node/index.mdx`)
91+
92+
### 6. Wizard-Based Frameworks
93+
94+
These frameworks use installation wizards and don't have OnboardingOptionButtons in their main docs:
95+
- Angular (`docs/platforms/javascript/guides/angular/index.mdx`)
96+
- Remix (`docs/platforms/javascript/guides/remix/index.mdx`)
97+
- Next.js (main guide - uses wizard)
98+
99+
## JavaScript Configuration Pattern
100+
101+
All JavaScript SDKs now use this consistent logs configuration:
102+
103+
```javascript
104+
// ___PRODUCT_OPTION_START___ logs-beta
105+
// Enable logs to be sent to Sentry
106+
_experiments: { enableLogs: true },
107+
// ___PRODUCT_OPTION_END___ logs-beta
108+
```
109+
110+
## Result
111+
112+
Now when users select the "Logs Beta" checkbox in any JavaScript SDK documentation, they will see the appropriate logs configuration code appear in their setup instructions. This includes:
113+
114+
**Browser Frameworks**: React, Vue, Svelte, Solid, Angular (via Capacitor)
115+
**Full-Stack Frameworks**: Astro, SvelteKit, Next.js, Nuxt, Remix
116+
**Server Frameworks**: Node.js, Express, Koa, NestJS
117+
**Runtime Environments**: Bun, Deno, Cloudflare Workers
118+
**Serverless**: AWS Lambda, GCP Functions
119+
**Mobile**: Capacitor (React, Vue, Angular variations)
120+
121+
The logs snippet will properly show/hide based on the checkbox state, matching the behavior of other product options like performance monitoring and session replay.

docs/platforms/javascript/common/index.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ Select which Sentry features you'd like to install in addition to Error Monitori
4747
<PlatformCategorySection notSupported={["server"]}>
4848
<PlatformSection notSupported={["javascript", "javascript.cordova"]}>
4949
<OnboardingOptionButtons
50-
options={["error-monitoring", "performance", "session-replay", "user-feedback"]}
50+
options={["error-monitoring", "performance", "session-replay", "user-feedback", "logs-beta"]}
5151
/>
5252
</PlatformSection>
5353
</PlatformCategorySection>
@@ -63,7 +63,7 @@ Select which Sentry features you'd like to install in addition to Error Monitori
6363
<PlatformCategorySection notSupported={["browser"]}>
6464
<PlatformSection notSupported={["javascript.bun"]}>
6565
<OnboardingOptionButtons
66-
options={["error-monitoring", "performance", "profiling"]}
66+
options={["error-monitoring", "performance", "profiling", "logs-beta"]}
6767
/>
6868
</PlatformSection>
6969

@@ -72,7 +72,7 @@ In addition to capturing errors, you can monitor interactions between multiple s
7272
Select which Sentry features you'd like to install in addition to Error Monitoring to get the corresponding installation and configuration instructions below.
7373

7474
<PlatformSection supported={["javascript.bun"]}>
75-
<OnboardingOptionButtons options={["error-monitoring", "performance"]} />
75+
<OnboardingOptionButtons options={["error-monitoring", "performance", "logs-beta"]} />
7676
</PlatformSection>
7777
</PlatformCategorySection>
7878

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

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Non-Node runtimes, like Vercel's Edge runtime or Cloudflare Pages, are currently
2626

2727
## Install
2828

29-
<OnboardingOptionButtons options={["error-monitoring", "performance", "profiling", "session-replay", "user-feedback"]} />
29+
<OnboardingOptionButtons options={["error-monitoring", "performance", "profiling", "session-replay", "user-feedback", "logs-beta"]} />
3030

3131
Sentry captures data by using an SDK within your application's runtime.
3232

@@ -119,6 +119,11 @@ Sentry.init({
119119
}),
120120
// ___PRODUCT_OPTION_END___ user-feedback
121121
],
122+
// ___PRODUCT_OPTION_START___ logs-beta
123+
124+
// Enable logs to be sent to Sentry
125+
_experiments: { enableLogs: true },
126+
// ___PRODUCT_OPTION_END___ logs-beta
122127
// ___PRODUCT_OPTION_START___ performance
123128

124129
// Define how likely traces are sampled. Adjust this value in production,
@@ -159,6 +164,11 @@ Sentry.init({
159164
nodeProfilingIntegration(),
160165
],
161166
// ___PRODUCT_OPTION_END___ profiling
167+
// ___PRODUCT_OPTION_START___ logs-beta
168+
169+
// Enable logs to be sent to Sentry
170+
_experiments: { enableLogs: true },
171+
// ___PRODUCT_OPTION_END___ logs-beta
162172
// ___PRODUCT_OPTION_START___ performance
163173

164174
// Define how likely traces are sampled. Adjust this value in production,

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

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Select which Sentry features you'd like to install in addition to Error Monitori
1616

1717
## Install
1818

19-
<OnboardingOptionButtons options={["error-monitoring", "performance", "session-replay", "user-feedback"]} />
19+
<OnboardingOptionButtons options={["error-monitoring", "performance", "session-replay", "user-feedback", "logs-beta"]} />
2020

2121
Sentry captures data by using an SDK within your application's runtime.
2222

@@ -137,6 +137,11 @@ Sentry.init(
137137
}),
138138
// ___PRODUCT_OPTION_END___ user-feedback
139139
],
140+
// ___PRODUCT_OPTION_START___ logs-beta
141+
142+
// Enable logs to be sent to Sentry
143+
_experiments: { enableLogs: true },
144+
// ___PRODUCT_OPTION_END___ logs-beta
140145
// ___PRODUCT_OPTION_START___ performance
141146

142147
// Set tracesSampleRate to 1.0 to capture 100%
@@ -223,6 +228,11 @@ Sentry.init(
223228
// ___PRODUCT_OPTION_END___ user-feedback
224229
],
225230

231+
// ___PRODUCT_OPTION_START___ logs-beta
232+
233+
// Enable logs to be sent to Sentry
234+
_experiments: { enableLogs: true },
235+
// ___PRODUCT_OPTION_END___ logs-beta
226236
// ___PRODUCT_OPTION_START___ performance
227237
// Set tracesSampleRate to 1.0 to capture 100%
228238
// of transactions for tracing.
@@ -304,6 +314,11 @@ Sentry.init(
304314
}),
305315
// ___PRODUCT_OPTION_END___ user-feedback
306316
],
317+
// ___PRODUCT_OPTION_START___ logs-beta
318+
319+
// Enable logs to be sent to Sentry
320+
_experiments: { enableLogs: true },
321+
// ___PRODUCT_OPTION_END___ logs-beta
307322
// ___PRODUCT_OPTION_START___ performance
308323

309324
// Set tracesSampleRate to 1.0 to capture 100%
@@ -370,6 +385,11 @@ Sentry.init(
370385
}),
371386
// ___PRODUCT_OPTION_END___ user-feedback
372387
],
388+
// ___PRODUCT_OPTION_START___ logs-beta
389+
390+
// Enable logs to be sent to Sentry
391+
_experiments: { enableLogs: true },
392+
// ___PRODUCT_OPTION_END___ logs-beta
373393
// ___PRODUCT_OPTION_START___ performance
374394

375395
// Set tracesSampleRate to 1.0 to capture 100%
@@ -433,6 +453,11 @@ Sentry.init(
433453
}),
434454
// ___PRODUCT_OPTION_END___ user-feedback
435455
],
456+
// ___PRODUCT_OPTION_START___ logs-beta
457+
458+
// Enable logs to be sent to Sentry
459+
_experiments: { enableLogs: true },
460+
// ___PRODUCT_OPTION_END___ logs-beta
436461
// ___PRODUCT_OPTION_START___ performance
437462

438463
// Set tracesSampleRate to 1.0 to capture 100%

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Select which Sentry features you'd like to install in addition to Error Monitori
1616

1717
## Install
1818

19-
<OnboardingOptionButtons options={["error-monitoring", "performance", "session-replay", "user-feedback"]} />
19+
<OnboardingOptionButtons options={["error-monitoring", "performance", "session-replay", "user-feedback", "logs-beta"]} />
2020

2121
Sentry captures data by using an SDK within your application's runtime.
2222

@@ -75,6 +75,11 @@ if (!DEV) {
7575
}),
7676
// ___PRODUCT_OPTION_END___ user-feedback
7777
],
78+
// ___PRODUCT_OPTION_START___ logs-beta
79+
80+
// Enable logs to be sent to Sentry
81+
_experiments: { enableLogs: true },
82+
// ___PRODUCT_OPTION_END___ logs-beta
7883
// ___PRODUCT_OPTION_START___ performance
7984

8085
// Set tracesSampleRate to 1.0 to capture 100%

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

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ categories:
1414
Choose the features you want to configure, and this guide will show you how:
1515

1616
<OnboardingOptionButtons
17-
options={["error-monitoring", "performance", "session-replay", "user-feedback"]}
17+
options={["error-monitoring", "performance", "session-replay", "user-feedback", "logs-beta"]}
1818
/>
1919

2020
<PlatformContent includePath="getting-started-features-expandable" />
@@ -68,6 +68,11 @@ Sentry.init({
6868
}),
6969
// ___PRODUCT_OPTION_END___ user-feedback
7070
],
71+
// ___PRODUCT_OPTION_START___ logs-beta
72+
73+
// Enable logs to be sent to Sentry
74+
_experiments: { enableLogs: true },
75+
// ___PRODUCT_OPTION_END___ logs-beta
7176
// ___PRODUCT_OPTION_START___ performance
7277

7378
// Set tracesSampleRate to 1.0 to capture 100%
@@ -121,6 +126,11 @@ Sentry.init({
121126
}),
122127
// ___PRODUCT_OPTION_END___ user-feedback
123128
],
129+
// ___PRODUCT_OPTION_START___ logs-beta
130+
131+
// Enable logs to be sent to Sentry
132+
_experiments: { enableLogs: true },
133+
// ___PRODUCT_OPTION_END___ logs-beta
124134
// ___PRODUCT_OPTION_START___ performance
125135

126136
// Set tracesSampleRate to 1.0 to capture 100%

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

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Select which Sentry features you'd like to install in addition to Error Monitori
1616

1717
## Install
1818

19-
<OnboardingOptionButtons options={["error-monitoring", "performance", "session-replay", "user-feedback"]} />
19+
<OnboardingOptionButtons options={["error-monitoring", "performance", "session-replay", "user-feedback", "logs-beta"]} />
2020

2121
Sentry captures data by using an SDK within your application's runtime.
2222

@@ -72,6 +72,11 @@ Sentry.init({
7272
}),
7373
// ___PRODUCT_OPTION_END___ user-feedback
7474
],
75+
// ___PRODUCT_OPTION_START___ logs-beta
76+
77+
// Enable logs to be sent to Sentry
78+
_experiments: { enableLogs: true },
79+
// ___PRODUCT_OPTION_END___ logs-beta
7580
// ___PRODUCT_OPTION_START___ performance
7681

7782
// Set tracesSampleRate to 1.0 to capture 100%
@@ -127,6 +132,11 @@ Sentry.init({
127132
}),
128133
// ___PRODUCT_OPTION_END___ user-feedback
129134
],
135+
// ___PRODUCT_OPTION_START___ logs-beta
136+
137+
// Enable logs to be sent to Sentry
138+
_experiments: { enableLogs: true },
139+
// ___PRODUCT_OPTION_END___ logs-beta
130140
// ___PRODUCT_OPTION_START___ performance
131141

132142
// Set tracesSampleRate to 1.0 to capture 100%

0 commit comments

Comments
 (0)