The Atatus mobile SDK forwards application logs from native Android and Android TV builds to Atatus over HTTP. Entries are batched on the device, enriched with attributes and tags you define, and bound to the RUM context active when they were emitted, so a log line resolves to the session and view that produced it.

Prerequisites

  • The Atatus SDK initialized in your application. See Android Monitoring Setup.
  • A RUM application in Atatus, which provisions the license key the SDK authenticates with.
Authenticate with the license key, never your account API key. Anything shipped inside an APK is recoverable through decompilation, and the license key is the only credential scoped for client-side distribution.

Setup

1. Add the logs dependency

Declare the logs library in your application module’s build script. It depends on the core SDK, so no additional coordinate is required:

2. Initialize the SDK

Logs share the core SDK instance with RUM, so initialization is identical to Android Monitoring Setup. Skip this step if the SDK is already initialized in your Application class:
Guard against emitting logs before initialization completes:

3. Enable the logs feature

Enabling the feature registers the logs intake pipeline and its batch storage:

4. Create a logger

A Logger is the entry point for emitting entries, and its builder fixes the enrichment and sampling applied to everything it sends. Create one per subsystem you want to filter on independently:
Logger.Builder options:

5. Send log messages

Each method maps to an Android log priority, which drives severity filtering and alerting in Atatus:
Pass a Throwable to record the exception and its stack trace alongside the message:
Attach attributes scoped to a single entry:

6. Add global attributes and tags

Attributes are structured key-value pairs that remain queryable in Atatus, unlike values interpolated into a message string. Scope them to one logger, or to every logger through the Logs feature:
Tags partition logs into facets for filtering and aggregation:
Remove attributes and tags once they fall out of scope, so later entries are not enriched with stale state:

Send data when the device is offline

Entries are serialized to batch files on disk and uploaded when network availability and battery level permit, so a session recorded offline is retained until connectivity returns. Batches exceeding their retention window are evicted to bound disk usage. No configuration is required.

Next steps