You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We would like to use the native sentry_log_*() / sentry_log() APIs in our Android app.
While we can enable logs via SentryAndroidOptions (logs.enabled / io.sentry.logs.enabled manifest key), when the native SDK is initialized through the NDK integration this flag is not passed on:
SentryNdk.init() builds the native options from NdkOptions, which only carries DSN, debug, outbox path, release, environment, dist, max breadcrumbs, and SDK name (plus handler strategy, traces sample rate, and app-hang settings) — see SentryNdk.java
sentry-native options are immutable after sentry_init(), which the NDK integration performs — so the app cannot set enable_logs itself afterward.
As a result, enable_logs is always false in the native SDK on Android, and every call to sentry_log_*() / sentry_log() from native code returns SENTRY_LOG_RETURN_DISABLED and is silently dropped — even when the user has explicitly enabled logs in their Android SDK configuration.
Solution Brainstorm
Forward options.getLogs().isEnabled() in SentryNdk.init() in sentry-java.
Add an enableLogs field to NdkOptions and apply it in the NDK init path via sentry_options_set_enable_logs().
Possibly also forward logs_with_attributes and consider routing beforeSendLog semantics, though the enable_logs flag alone would unblock the feature.
Native logs are sent through the outbox/envelope path, so ingestion should work with the existing transport once the option is enabled.
Activity
linear-code commentedon Aug 7, 2026
JAVA-688
romtsn commentedon Aug 10, 2026
hi @triplef this is a reasonable FR -- I've opened #5923 and getsentry/sentry-native#1971 to address it, should likely land in the next release!
triplef commentedon Aug 10, 2026
Awesome, thank you @romtsn!
triplef commentedon Sep 10, 2026
Thanks — this works now in the latest releases. Closing.