Skip to content

Commit 7e020de

Browse files
committed
Add logs beta configuration across multiple platforms and SDKs
1 parent a510dcf commit 7e020de

File tree

16 files changed

+257
-3
lines changed

16 files changed

+257
-3
lines changed

LOGS_BETA_CONFIGURATION_FIXES.md

Lines changed: 148 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,148 @@
1+
# Logs Beta Configuration Fixes
2+
3+
This document summarizes all the fixes made to ensure that when users select the "Logs Beta" checkbox, the corresponding logs setup code appears in the getting started configuration for all supported SDKs.
4+
5+
## Issue Fixed
6+
7+
The user reported that when selecting the "Logs Beta" checkbox, they didn't see the logs snippet being added to the getting started code. This was because while the checkbox was added to the UI, the actual logs configuration code with proper product option markers was missing from many platform configuration files.
8+
9+
## Solution
10+
11+
Added logs-beta configuration with `___PRODUCT_OPTION_START___ logs-beta` and `___PRODUCT_OPTION_END___ logs-beta` markers to all platform configuration files.
12+
13+
## Files Updated
14+
15+
### 1. Core Configuration Files (platform-includes/getting-started-config/)
16+
17+
#### Python
18+
- **File**: `platform-includes/getting-started-config/python.mdx`
19+
- **Added**: `'logs-beta'` to OnboardingOptionButtons
20+
- **Configuration**: `_experiments={"enable_logs": True}`
21+
22+
#### JavaScript Node.js
23+
- **File**: `platform-includes/getting-started-config/javascript.node.mdx`
24+
- **Configuration**: `_experiments: { enableLogs: true }`
25+
- **Added to**: Both CommonJS and ESM code blocks
26+
27+
#### JavaScript AWS Lambda
28+
- **File**: `platform-includes/getting-started-config/javascript.aws-lambda.mdx`
29+
- **Configuration**: `_experiments: { enableLogs: true }`
30+
- **Added to**: Both async and sync handlers
31+
32+
#### JavaScript GCP Functions
33+
- **File**: `platform-includes/getting-started-config/javascript.gcp-functions.mdx`
34+
- **Configuration**: `_experiments: { enableLogs: true }`
35+
- **Added to**: Http, Background, and CloudEvent functions
36+
37+
#### JavaScript Cloudflare Workers
38+
- **File**: `platform-includes/getting-started-config/javascript.cloudflare.workers.mdx`
39+
- **Configuration**: `_experiments: { enableLogs: true }`
40+
41+
#### JavaScript NestJS
42+
- **File**: `platform-includes/getting-started-config/javascript.nestjs.mdx`
43+
- **Configuration**: `_experiments: { enableLogs: true }`
44+
45+
#### Ruby Rails
46+
- **File**: `platform-includes/getting-started-config/ruby.rails.mdx`
47+
- **Configuration**: `config.enable_logs = true`
48+
49+
#### Ruby Rack
50+
- **File**: `platform-includes/getting-started-config/ruby.rack.mdx`
51+
- **Configuration**: `config.enable_logs = true`
52+
- **Added to**: Both Rackup and non-Rackup configurations
53+
54+
#### Ruby Resque
55+
- **File**: `platform-includes/getting-started-config/ruby.resque.mdx`
56+
- **Configuration**: `config.enable_logs = true`
57+
58+
#### Java Spring Boot
59+
- **File**: `platform-includes/getting-started-config/java.spring-boot.mdx`
60+
- **Configuration**:
61+
- Properties: `sentry.logs.enabled=true`
62+
- YAML: `logs: enabled: true`
63+
64+
#### Go
65+
- **File**: `platform-includes/getting-started-config/go.mdx`
66+
- **Configuration**: `EnableLogs: true`
67+
68+
### 2. Platform Documentation Files (docs/platforms/)
69+
70+
#### Go Guides
71+
- **Files**:
72+
- `docs/platforms/go/guides/echo/index.mdx`
73+
- `docs/platforms/go/guides/http/index.mdx`
74+
- `docs/platforms/go/guides/fiber/index.mdx`
75+
- `docs/platforms/go/guides/iris/index.mdx`
76+
- **Added**: `'logs-beta'` to OnboardingOptionButtons
77+
- **Configuration**: `EnableLogs: true`
78+
79+
### 3. Previously Updated Files (from initial implementation)
80+
81+
#### Main Platform Files
82+
- `docs/platforms/android/index.mdx`
83+
- `docs/platforms/dart/guides/flutter/index.mdx` ✓ (already had complete config)
84+
- `docs/platforms/php/index.mdx`
85+
- `docs/platforms/python/index.mdx`
86+
- `docs/platforms/ruby/common/index.mdx`
87+
- `docs/platforms/go/guides/gin/index.mdx`
88+
- `docs/platforms/javascript/guides/react/index.mdx`
89+
- `docs/platforms/javascript/guides/nextjs/manual-setup.mdx`
90+
91+
#### Configuration Files
92+
- `platform-includes/getting-started-config/javascript.mdx`
93+
- `platform-includes/getting-started-config/java.mdx`
94+
- `platform-includes/getting-started-config/ruby.mdx`
95+
96+
## Configuration Patterns by Platform
97+
98+
### JavaScript/Node.js
99+
```javascript
100+
_experiments: { enableLogs: true }
101+
```
102+
103+
### Python
104+
```python
105+
_experiments={"enable_logs": True}
106+
```
107+
108+
### Ruby
109+
```ruby
110+
config.enable_logs = true
111+
```
112+
113+
### Java
114+
```java
115+
// Java SDK
116+
options.getLogs().setEnabled(true)
117+
118+
// Spring Boot Properties
119+
sentry.logs.enabled=true
120+
121+
// Spring Boot YAML
122+
logs:
123+
enabled: true
124+
```
125+
126+
### Go
127+
```go
128+
EnableLogs: true
129+
```
130+
131+
### Android
132+
```xml
133+
<meta-data android:name="io.sentry.logs.enabled" android:value="true" />
134+
```
135+
136+
### Flutter/Dart
137+
```dart
138+
options.enableLogs = true;
139+
```
140+
141+
### PHP
142+
```php
143+
'enable_logs' => true
144+
```
145+
146+
## Result
147+
148+
Now when users select the "Logs Beta" checkbox in any of the supported SDKs (Java, Android, Flutter, PHP, Python, Ruby, Go, and all JavaScript SDKs), they will see the appropriate logs configuration code appear in their setup instructions with the proper product option markers that integrate with the checkbox functionality.

docs/platforms/go/guides/echo/index.mdx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ Select which Sentry features you'd like to install in addition to Error Monitori
1818
<OnboardingOptionButtons
1919
options={[
2020
'error-monitoring',
21-
'performance'
21+
'performance',
22+
'logs-beta',
2223
]}
2324
/>
2425

@@ -49,6 +50,10 @@ if err := sentry.Init(sentry.ClientOptions{
4950
// We recommend adjusting this value in production,
5051
TracesSampleRate: 1.0,
5152
// ___PRODUCT_OPTION_END___ performance
53+
// ___PRODUCT_OPTION_START___ logs-beta
54+
// Enable logs to be sent to Sentry
55+
EnableLogs: true,
56+
// ___PRODUCT_OPTION_END___ logs-beta
5257
// Adds request headers and IP for users,
5358
// visit: https://docs.sentry.io/platforms/go/data-management/data-collected/ for more info
5459
SendDefaultPII: true,

docs/platforms/go/guides/fiber/index.mdx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ documentation](https://godoc.org/github.com/getsentry/sentry-go/fiber).
1616
options={[
1717
'error-monitoring',
1818
'performance',
19+
'logs-beta',
1920
]}
2021
/>
2122

@@ -44,6 +45,10 @@ if err := sentry.Init(sentry.ClientOptions{
4445
// We recommend adjusting this value in production,
4546
TracesSampleRate: 1.0,
4647
// ___PRODUCT_OPTION_END___ performance
48+
// ___PRODUCT_OPTION_START___ logs-beta
49+
// Enable logs to be sent to Sentry
50+
EnableLogs: true,
51+
// ___PRODUCT_OPTION_END___ logs-beta
4752
// Adds request headers and IP for users,
4853
// visit: https://docs.sentry.io/platforms/go/data-management/data-collected/ for more info
4954
SendDefaultPII: true,

docs/platforms/go/guides/http/index.mdx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ Select which Sentry features you'd like to install in addition to Error Monitori
1919
options={[
2020
'error-monitoring',
2121
'performance',
22+
'logs-beta',
2223
]}
2324
/>
2425

@@ -48,6 +49,10 @@ if err := sentry.Init(sentry.ClientOptions{
4849
// We recommend adjusting this value in production,
4950
TracesSampleRate: 1.0,
5051
// ___PRODUCT_OPTION_END___ performance
52+
// ___PRODUCT_OPTION_START___ logs-beta
53+
// Enable logs to be sent to Sentry
54+
EnableLogs: true,
55+
// ___PRODUCT_OPTION_END___ logs-beta
5156
// Adds request headers and IP for users,
5257
// visit: https://docs.sentry.io/platforms/go/data-management/data-collected/ for more info
5358
SendDefaultPII: true,

docs/platforms/go/guides/iris/index.mdx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ Select which Sentry features you'd like to install in addition to Error Monitori
1919
options={[
2020
'error-monitoring',
2121
'performance',
22+
'logs-beta',
2223
]}
2324
/>
2425

@@ -48,6 +49,10 @@ if err := sentry.Init(sentry.ClientOptions{
4849
// We recommend adjusting this value in production,
4950
TracesSampleRate: 1.0,
5051
// ___PRODUCT_OPTION_END___ performance
52+
// ___PRODUCT_OPTION_START___ logs-beta
53+
// Enable logs to be sent to Sentry
54+
EnableLogs: true,
55+
// ___PRODUCT_OPTION_END___ logs-beta
5156
// Adds request headers and IP for users,
5257
// visit: https://docs.sentry.io/platforms/go/data-management/data-collected/ for more info
5358
SendDefaultPII: true,

platform-includes/getting-started-config/go.mdx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ func main() {
1717
// Adds request headers and IP for users,
1818
// visit: https://docs.sentry.io/platforms/go/data-management/data-collected/ for more info
1919
SendDefaultPII: true,
20+
// ___PRODUCT_OPTION_START___ logs-beta
21+
// Enable logs to be sent to Sentry
22+
EnableLogs: true,
23+
// ___PRODUCT_OPTION_END___ logs-beta
2024
})
2125
if err != nil {
2226
log.Fatalf("sentry.Init: %s", err)

platform-includes/getting-started-config/java.spring-boot.mdx

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@ sentry.dsn=___PUBLIC_DSN___
99
# Add data like request headers and IP for users,
1010
# see https://docs.sentry.io/platforms/java/guides/spring-boot/data-management/data-collected/ for more info
1111
sentry.send-default-pii=true
12+
# ___PRODUCT_OPTION_START___ logs-beta
13+
14+
# Enable logs to be sent to Sentry
15+
sentry.logs.enabled=true
16+
# ___PRODUCT_OPTION_END___ logs-beta
1217
# ___PRODUCT_OPTION_START___ performance
1318

1419
# Set traces_sample_rate to 1.0 to capture 100%
@@ -25,6 +30,12 @@ sentry:
2530
# Add data like request headers and IP for users,
2631
# see https://docs.sentry.io/platforms/java/guides/spring-boot/data-management/data-collected/ for more info
2732
send-default-pii: true
33+
# ___PRODUCT_OPTION_START___ logs-beta
34+
35+
# Enable logs to be sent to Sentry
36+
logs:
37+
enabled: true
38+
# ___PRODUCT_OPTION_END___ logs-beta
2839
# ___PRODUCT_OPTION_START___ performance
2940

3041
# Set traces_sample_rate to 1.0 to capture 100%
@@ -47,4 +58,4 @@ sentry:
4758
4859
We recommend using Sentry's Spring Boot integration with one of the [logging framework integrations](logging-frameworks/) as they work together seamlessly. To use Sentry **without** Spring Boot, we recommend using the [Sentry Spring integration](/platforms/java/guides/spring/).
4960
50-
Once this integration is configured you can _also_ use Sentrys static API, [as shown on the usage page](usage/), to record breadcrumbs, set the current user, or manually send events, for example.
61+
Once this integration is configured you can _also_ use Sentry's static API, [as shown on the usage page](usage/), to record breadcrumbs, set the current user, or manually send events, for example.

platform-includes/getting-started-config/javascript.aws-lambda.mdx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@ Sentry.init({
1616
nodeProfilingIntegration(),
1717
],
1818
// ___PRODUCT_OPTION_END___ profiling
19+
// ___PRODUCT_OPTION_START___ logs-beta
20+
21+
// Enable logs to be sent to Sentry
22+
_experiments: { enableLogs: true },
23+
// ___PRODUCT_OPTION_END___ logs-beta
1924
// ___PRODUCT_OPTION_START___ performance
2025

2126
// Add Performance Monitoring by setting tracesSampleRate
@@ -55,6 +60,11 @@ Sentry.init({
5560
nodeProfilingIntegration(),
5661
],
5762
// ___PRODUCT_OPTION_END___ profiling
63+
// ___PRODUCT_OPTION_START___ logs-beta
64+
65+
// Enable logs to be sent to Sentry
66+
_experiments: { enableLogs: true },
67+
// ___PRODUCT_OPTION_END___ logs-beta
5868
// ___PRODUCT_OPTION_START___ performance
5969

6070
// Add Performance Monitoring by setting tracesSampleRate

platform-includes/getting-started-config/javascript.cloudflare.workers.mdx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@ export default Sentry.withSentry(
1818
// https://docs.sentry.io/platforms/javascript/guides/cloudflare/configuration/options/#sendDefaultPii
1919
sendDefaultPii: true,
2020

21+
// ___PRODUCT_OPTION_START___ logs-beta
22+
// Enable logs to be sent to Sentry
23+
_experiments: { enableLogs: true },
24+
// ___PRODUCT_OPTION_END___ logs-beta
25+
2126
// ___PRODUCT_OPTION_START___ performance
2227
// Set tracesSampleRate to 1.0 to capture 100% of spans for tracing.
2328
// Learn more at

platform-includes/getting-started-config/javascript.gcp-functions.mdx

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@ Sentry.init({
1212
integrations: [
1313
nodeProfilingIntegration(),
1414
],
15+
// ___PRODUCT_OPTION_START___ logs-beta
16+
17+
// Enable logs to be sent to Sentry
18+
_experiments: { enableLogs: true },
19+
// ___PRODUCT_OPTION_END___ logs-beta
1520
// ___PRODUCT_OPTION_START___ performance
1621

1722
// Add Performance Monitoring by setting tracesSampleRate
@@ -47,6 +52,11 @@ Sentry.init({
4752
integrations: [
4853
nodeProfilingIntegration(),
4954
],
55+
// ___PRODUCT_OPTION_START___ logs-beta
56+
57+
// Enable logs to be sent to Sentry
58+
_experiments: { enableLogs: true },
59+
// ___PRODUCT_OPTION_END___ logs-beta
5060
// ___PRODUCT_OPTION_START___ performance
5161

5262
// Add Performance Monitoring by setting tracesSampleRate
@@ -83,6 +93,11 @@ Sentry.init({
8393
nodeProfilingIntegration(),
8494
],
8595
// ___PRODUCT_OPTION_END___ profiling
96+
// ___PRODUCT_OPTION_START___ logs-beta
97+
98+
// Enable logs to be sent to Sentry
99+
_experiments: { enableLogs: true },
100+
// ___PRODUCT_OPTION_END___ logs-beta
86101
// ___PRODUCT_OPTION_START___ performance
87102

88103
// Add Performance Monitoring by setting tracesSampleRate

0 commit comments

Comments
 (0)