Skip to content

Commit cf4cb35

Browse files
authored
feat(sdk): enable logs in docs (#14489)
Realized we never dogfooded logs in docs, let's give it a try.
1 parent 14dac89 commit cf4cb35

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

src/instrumentation-client.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ Sentry.init({
77
// Adjust this value in production, or use tracesSampler for greater control
88
tracesSampleRate: 1,
99

10+
// Enable logs to be sent to Sentry
11+
enableLogs: true,
12+
1013
// Setting this option to true will print useful information to the console while you're setting up Sentry.
1114
debug: false,
1215

@@ -30,6 +33,7 @@ Sentry.init({
3033
Sentry.browserTracingIntegration({
3134
linkPreviousTrace: 'session-storage',
3235
}),
36+
Sentry.consoleLoggingIntegration(),
3337
],
3438
});
3539

src/instrumentation.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,22 @@ export function register() {
55
Sentry.init({
66
dsn: process.env.SENTRY_DSN,
77
tracesSampleRate: 1,
8+
enableLogs: true,
89
debug: false,
910
environment: process.env.NODE_ENV === 'development' ? 'development' : undefined,
1011
spotlight: process.env.NODE_ENV === 'development',
12+
integrations: [Sentry.consoleLoggingIntegration()],
1113
});
1214
}
1315

1416
if (process.env.NEXT_RUNTIME === 'edge') {
1517
Sentry.init({
1618
dsn: process.env.SENTRY_DSN,
1719
tracesSampleRate: 1,
20+
enableLogs: true,
1821
debug: false,
1922
environment: process.env.NODE_ENV === 'development' ? 'development' : undefined,
23+
integrations: [Sentry.consoleLoggingIntegration()],
2024
// temporary change for investigating edge middleware tx names
2125
beforeSendTransaction(event) {
2226
if (

0 commit comments

Comments
 (0)