Introduction
Some of our customers have asked us if DataSet's API can be used to upload logs from Android clients.
An example use case is: "We have client-generated anomalies that need to be monitored."
You can use the API to upload logs from an Android the below links can help you get started
Sending logs from Android to DataSet is simple, although an Android installation won't have the same level of control as directly using the DataSet API or Agent. Additionally, the API token will need to be installed within the Android application that utilizes our APIs.
The recommended design practice is to send logs from your Android devices to a central location within your infrastructure. This enables you to filter and potentially modify the logs before uploading them to DataSet.
Ingest Android Logs
From Host Machine (tethered)
In order to make use of the following steps, your phone will need to be tethered to a host machine. The Scalyr Agent will then upload logs from the path you designate, which is useful for most development use cases
- Install ADB (instructions)
- Install the Scalyr Agent (scroll down to the Linux / tarball / Windows installation instructions from here)
- Update the Scalyr Agent config file to include path(s) of log files to upload. More information can be found here. For example:
...
logs: [
{
path: "C:\\Users\\krist\\Downloads\\AndroidLogs\\android-debug.log",
attributes: {parser: "test-Android"}
}
]
...
Integrated Logging Support
If you want to send logs to DataSet without being tethered you would need to build some additional functionality into into your application. Please note that this is beyond the scope of our discussion, however, the following reference links may be of assistance:
- https://medium.com/@tofira/how-we-built-a-remote-logging-system-in-android-1ffc05fd6928
- https://code.google.com/archive/p/android-remote-stacktrace/ (again, we'd recommend sending messages like this to a central location)
Comments
0 comments
Please sign in to leave a comment.