Summary
Today, PostHog Logs on Android is manual capture only โ you emit logs explicitly via captureLog(...) / the logger API. The SDK does not automatically capture the platform's native log streams.
We're considering adding autocapture for native logs so existing logging "just works" with zero extra instrumentation, and we'd like to gauge how much demand there is before building it.
๐ this issue if you'd use it. Comments about your use case are even more helpful.
Current behavior
Logs are only sent when you call them yourself:
PostHog.logger.info("checkout completed", mapOf("order_id" to "ord_789"))
The following are not captured automatically: android.util.Log (Logcat) and Timber.
Proposed behavior
An opt-in config flag (e.g. logs.autocaptureNativeLogs = true) that hooks into android.util.Log (Logcat) and Timber and forwards them as PostHog log records โ respecting the existing severity mapping, beforeSend redaction, rate cap, and resource attributes.
Related issues (other SDKs)
Same proposal is being tracked across our mobile SDKs:
Posted by the mobile SDK team to gauge interest โ not yet scheduled.
Summary
Today, PostHog Logs on Android is manual capture only โ you emit logs explicitly via
captureLog(...)/ theloggerAPI. The SDK does not automatically capture the platform's native log streams.We're considering adding autocapture for native logs so existing logging "just works" with zero extra instrumentation, and we'd like to gauge how much demand there is before building it.
๐ this issue if you'd use it. Comments about your use case are even more helpful.
Current behavior
Logs are only sent when you call them yourself:
The following are not captured automatically:
android.util.Log(Logcat) andTimber.Proposed behavior
An opt-in config flag (e.g.
logs.autocaptureNativeLogs = true) that hooks intoandroid.util.Log(Logcat) andTimberand forwards them as PostHog log records โ respecting the existing severity mapping,beforeSendredaction, rate cap, and resource attributes.Related issues (other SDKs)
Same proposal is being tracked across our mobile SDKs:
Posted by the mobile SDK team to gauge interest โ not yet scheduled.