Published on
June 10
Logging is an important and essential part of Software Development. Here, developers often use logging to see and understand what the “application code” is really doing.
In Android, the SDK has a built-in class called Log Class. In parallel, The Logcat window in Android Studio displays system messages, such as when a garbage collection occurs, and messages that we added to the app with the Log class. This Log class also contains utility methods to log messages with different priorities. This works very well for the developers to find and fix bugs while using an emulator or devices accessible to them.
Now, what happens if a tester finds a bug in their device or a bug occurs in a production user device? It will be very hard for the developers to find the root cause and fix the bug if they are not able to replicate or if they don’t have enough logs available.
To assist these situations, developers are mostly familiar with tools such as Google Analytics or Crashlytics but they are analytics or crash reporting tools, and not fully-fledged logging solutions.
Crashlytics can provide the logs when a crash occurs but not all errors or malfunctions in an application result in a crash. For example, a logic error in a program can cause the software to operate incorrectly, but not to terminate abnormally (or crash). One of the ways to pinpoint this kind of bugs in the code is writing proper logs and analysing them. In short, Crashlytics can help you find the location of the crash but If you also had the logs then it would be much easier to find the source of the issue.
There are many Logger libraries available for developers, e.g., Android-Logger and Timber. But these libraries print log messages on Logcat in Android Studio that doesn’t help to get the behaviour of the app in production, which means that these log messages aren’t accessible to the developers.
AppLogz is a fully-fledged remote logging solution for Android and iOS. It is a powerful lightweight library which can be integrated easily into an application and use it the same way we write logs using the built-in API’s (Log). Every log we write using the library API will be printed on the console as well as uploaded to the remote console where users can search and find the logs for debugging and fixing the bugs.
Real-time logging: AppLogz enables users to collect all types of logs efficiently and will be able to see it in the remote console real-time.
Remote configuration: AppLogz provide remote configurations with which users can tailor logging to their specific requirements by adjusting frequency, type and size
Analysis dashboard: Kibana based remote dashboard can be used to analyse log data and narrow down issues
Customize logs: Easily customize data that is sent from the app. Developers can add their own data and events.
AppLogz client library can be integrated into an Android app with two steps
Download the latest version or grab via Gradle.
AppLogz SDK is available in Github packages.
Implementation ('com.tarams.applogz:applogz:<latest_version>@aar'){ transitive=true}
Initialize the SDK in the Application class onCreate method
AppLogz.initilize(this,"<Your Token>","<Host: ipAddress>","<protocolType: http or https>");
Then, use the SDK Logger class to log the messages
AppLogz.i("Log message");
That’s it. Now, all the logs printed using the Logger class will be recorded and uploaded to the remote console.
Applogz remote console allows users to search and analyze the real time logs on a per-user and session basis.
Having a remote logging solution integrated into the app always helps developers to track bugs quickly and make the product bugfree. Applogz is lightweight and has a minimal learning curve which makes it the best solution for the purpose.