Skip to content

[Logs 14] Add Manifest option for enabling Logs #4395

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 34 commits into from
May 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
0627186
Add Log feature to Java SDK
adinauer May 6, 2025
27a24ec
Rate limit for log items
adinauer May 6, 2025
0c75319
Add options for logs
adinauer May 7, 2025
bc8caf7
Add batch processor for logs
adinauer May 8, 2025
38c3dcd
Use a separate ExecutorService for log batching
adinauer May 8, 2025
c639bfc
Reduce locking when log event is created
adinauer May 8, 2025
217f7c7
Add system tests for Logs
adinauer May 12, 2025
fef4582
Separate enum for SentryLogLevel
adinauer May 12, 2025
ac2bce7
Remove logsSampleRate option
adinauer May 12, 2025
50078d0
Move logs options out of experimental namespace
adinauer May 12, 2025
d0fef91
Add severity_number to SentryLogItem
adinauer May 12, 2025
60dc14b
Logs review feedback
adinauer May 12, 2025
69d6a81
mark captureBatchedLogEvents internal
adinauer May 13, 2025
88f4c96
remove hint for logs
adinauer May 13, 2025
44211bd
Attach server.address to logs
adinauer May 13, 2025
4000978
Add io.sentry.logs.enabled to Manifest
adinauer May 13, 2025
e7c9212
Allow null for log event attribute value
adinauer May 13, 2025
3263bc1
Merge branch 'feat/logs-review-feedback' into feat/logs-server-address
adinauer May 13, 2025
d203a97
Merge branch 'feat/logs-server-address' into feat/logs-manifest-option
adinauer May 13, 2025
5ba33fd
Merge branch 'main' into feat/logs-e2e-tests
adinauer May 13, 2025
a7afc9d
Merge branch 'feat/logs-e2e-tests' into feat/separate-log-level-enum
adinauer May 13, 2025
164f210
Merge branch 'main' into feat/separate-log-level-enum
adinauer May 13, 2025
893b67c
Merge branch 'feat/separate-log-level-enum' into feat/remove-logs-sam…
adinauer May 13, 2025
80e5bb9
Merge branch 'main' into feat/remove-logs-sample-rate-option
adinauer May 13, 2025
c1ca9be
Merge branch 'feat/remove-logs-sample-rate-option' into feat/logs-not…
adinauer May 13, 2025
808b4e6
Merge branch 'main' into feat/logs-not-experimental
adinauer May 13, 2025
e167f1b
Merge branch 'feat/logs-not-experimental' into feat/logs-severity-number
adinauer May 13, 2025
c07e44c
Merge branch 'main' into feat/logs-severity-number
adinauer May 13, 2025
888ab48
Merge branch 'feat/logs-severity-number' into feat/logs-review-feedback
adinauer May 13, 2025
7894f55
Merge branch 'main' into feat/logs-review-feedback
adinauer May 13, 2025
ddbca2b
Merge branch 'feat/logs-review-feedback' into feat/logs-server-address
adinauer May 13, 2025
17ad65f
Merge branch 'main' into feat/logs-server-address
adinauer May 13, 2025
56df3b1
Merge branch 'feat/logs-server-address' into feat/logs-manifest-option
adinauer May 13, 2025
adb5eb8
Merge branch 'main' into feat/logs-manifest-option
adinauer May 13, 2025
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
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,8 @@ final class ManifestMetadataReader {

static final String IN_APP_EXCLUDES = "io.sentry.in-app-excludes";

static final String ENABLE_LOGS = "io.sentry.logs.enabled";

static final String ENABLE_AUTO_TRACE_ID_GENERATION =
"io.sentry.traces.enable-auto-id-generation";

Expand Down Expand Up @@ -471,6 +473,10 @@ static void applyMetadata(
options.addInAppExclude(exclude);
}
}

options
.getLogs()
.setEnabled(readBool(metadata, logger, ENABLE_LOGS, options.getLogs().isEnabled()));
}
options
.getLogger()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1590,4 +1590,29 @@ class ManifestMetadataReaderTest {
// Assert
assertTrue(fixture.options.inAppExcludes.isEmpty())
}

@Test
fun `applyMetadata reads logs enabled and keep default value if not found`() {
// Arrange
val context = fixture.getContext()

// Act
ManifestMetadataReader.applyMetadata(context, fixture.options, fixture.buildInfoProvider)

// Assert
assertFalse(fixture.options.logs.isEnabled)
}

@Test
fun `applyMetadata reads logs enabled to options`() {
// Arrange
val bundle = bundleOf(ManifestMetadataReader.ENABLE_LOGS to true)
val context = fixture.getContext(metaData = bundle)

// Act
ManifestMetadataReader.applyMetadata(context, fixture.options, fixture.buildInfoProvider)

// Assert
assertTrue(fixture.options.logs.isEnabled)
}
}
Loading