Send Android App Logs to Loggly
You can send your Android logs using our timber-loggly package. It sends logs directly from your application to Loggly using the HTTP/S Event API. For alternatives, please see the Advanced Options section.
Android Logging Setup
1. Add timber-loggly jar
Add a dependency for the timber-loggly jar from the Maven repository or from GitHub. The Maven repository has code snippets to add the dependencies for many common package managers.
For example, if you are using Maven, then add this to the dependencies section of your pom.xml file.
<dependency> <groupId>com.github.tony19</groupId> <artifactId>timber-loggly</artifactId> <version>1.0.1</version> </dependency>
2. Configure timber-loggly
Plant a LogglyTree with your authorization token from Loggly.
import android.app.Application;
import com.github.tony19.timber.loggly.LogglyTree;
import timber.log.Timber;
public class ExampleApp extends Application {
@Override
public void onCreate() {
super.onCreate();
final String LOGGLY_TOKEN = "TOKEN";
Timber.plant(new LogglyTree(LOGGLY_TOKEN));
}
}
Use Timber API to log an event via LogglyTree
Timber.tag("android"); Timber.i("hello world");
Replace:
- TOKEN: your customer token from the source setup page
3. Send Test Events
Run your application to send test events to Loggly.
Search Loggly for events with the android tag over the past 20 minutes. It may take a few minutes to index the event. If it doesn’t work, see the troubleshooting section below.
tag:android
Click on one of the logs to show a list of JSON fields (see screenshot below).
Advanced Android Logging Options
- Package Docs – Describes how to send android logs, use tags, and more
- HTTP/S Bulk Endpoint – Send up to 5MB batches of logs over HTTP/S for higher performance
- Loggly Libraries Catalog – New libraries are added to our catalog
- Search or post your own Android logging or custom logging questions in the community forum.
Troubleshooting Android Logs
If you don’t see any data show up in the verification step, then check for these common problems.
-
Check timber-loggly:
- Wait a few minutes in case indexing needs to catch up
- See our HTTP Troubleshooting Guide to verify HTTP events are being sent to Loggly.
- Search or post your own questions on Android logging levels, file transport, log messages, and more in the community forum.
Still Not Working?