Skip to main content

AppCenter - Crashlog Sink Using AppCenter



Introduction
Appcenter is a Microsoft features product that helps developers/testers/maintainers manage our apps that has been published to the wild. Previously it was known as HockeyApp. In this article, we are going to discuss on how to strategize/handle/manage our crash report mechanism. Since our solution policies may varies between countries, this article will somehow propose a design technique on how to organize our app crash report that is used based on country.

Consideration
This code base is proposed for the intention of specific problem domain that we might encounter throughout our development lifecycle, for production/release we might need to tweak it to meet the company policy, best practice and industry standards. The code snippet is free to use anywhere.

The Assumption
Assuming we are dealing with a lot of phases in our development life cycle, Things like a blue green deployment, Development phase, Testing, and even production-live solutions. It is always nice to segregate our crashlog report in each phase for troubleshooting purpose. If we are deploying our solution worldwide, it is also nice to be able to segregate the crash log based on country, Assuming we have created our android app like below.


We then may design our Apps to use something like below

Create A .Net Standard Library With Nuget Referenced to AppCenter

We going to need Nuget Reference to 3 type of library


Create All The Environment Variables

Next, we create all the related environment variables that we wish to segregate our crash log to. These variables assuming that we are segregating the sink based on their country and development phases.

Create The Map Logic

Once we are done with all the environment variables, we now may map the AppCenter keys with our desired environment.

The Reporting Mechanism

We Then create a lightweight crash report helper to log our crash exceptions, based on the code snippet above, we decide to add an overloading to the method just in case the client require some data along with the exceptions.

Hooking Up App Variables With A Start Method

We then may hook up the CrashReport key with our desired app environment.

Finally, The App Who Consume The Sink

Finally , we may then just call the app environment settings to map the crash report sink in our App like above.

Conclusion
From the article, we may conclude that it is important to design our App crash report 'sinks' to help us manage/troubleshoot our application in the wild. We may also assign specific individual based on the Env/Country through app center, this way we have a little management delegation on assigning appropriate users in our AppCenter organizations.

Published on : 4-Jan-2018
Ref no : DDN-WPUB-000214

About Author

My photo
Wan Mohd Adzha MCPD,MCSD,MCSE
I am passionate about technology and of course love Durians. Certified by Microsoft as MCP Since 2011. Blogging from Malaysia

Comments