Reputation: 1844
I've a complete admin app which I've published just a few days back. Sometimes end users report issues with the published application while it's not reproducible at my end.
Is there a tool available for tracing my log generated by any device which is using my application?
Upvotes: 1
Views: 2114
Reputation: 2504
The previous answeres were mainly talking about crash reporting. But there is much more to logs than crash reporting.
Exactly for this, we created Shipbook.
Shipbook gives you the power to remotely gather, search and analyze your user mobile app logs and exceptions in the cloud, on a per-user & session basis.
Upvotes: 0
Reputation: 343
We may find a lot of tools if googled but I think it will be good to use our own solution for this as the app might log sensitive info.
If your app is communicating with your own backend server then you can write an additional webservice which can save (in db) whatever exceptions occurring in the app. You have to send the app log details to the server to save it in the db. If there is an administrative web account for this app you can add an option to list these logs from the db. This will be secure as you are not sending app log to a third party tool to log.
Another secure solution is hosting any tool like this (which can show realtime log from your device) in your own server.
Upvotes: 0
Reputation: 1367
You can use Google Analytics API part for handling exceptions. It also provides facilities for collecting stack traces. (this is an exmaple from the API pages)
// Using StandardExceptionParser to get an Exception description.
try {
// Request some scores from the network.
ArrayList<Integer> highScores = getHighScoresFromCloud();
} catch (IOException e) {
// Get tracker.
Tracker t = ((AnalyticsSampleApp) getActivity().getApplication()).getTracker(
TrackerName.APP_TRACKER);
t.send(new HitBuilders.ExceptionBuilder()
.setDescription(
new StandardExceptionParser(this, null)
.getDescription(Thread.currentThread().getName(), e))
.setFatal(false)
.build()
);
... // Display alert to user that high scores are currently unavailable.
}
Afterwards all tracked stracktraces will be display in the Google Developer Console in the tap of you app.
You can also add an Listener for catching unhandled exceptions. So whenever an exceptions occours which you did not expect whis handler will be invoked.
Thread.setDefaultUncaughtExceptionHandler(new MyReportHelper());
Of course you should always try to catch and handle all exceptions which you know of, this handler is only for emergencies. For more details how an handler could look like see here.
Upvotes: 0
Reputation: 29722
Crashlytics (by Fabric) offers Custom Logging and Custom Keys which provide a way of logging remotely to their servers.
I have used this with great success in the past for exactly this reason - it gives you insight to the app flow without having to get physical access to the device.
The default call for logging a message is:
Crashlytics.getInstance().core.log(int priority, String tag, String msg);
This will write to LogCat as well as to Crashlytics.
Alternatively, just provide a message to skip logging to LogCat. As per example on website:
Crashlytics.getInstance().core.log("Higgs-Boson detected! Bailing out...");
Upvotes: 1
Reputation: 725
Use one of these services (of course you could find other, but these are the most popular):
I personally use crashlytics, because they show the exceptions thrown very good.
-- EDIT -- from you latest comment, there is no way (I now) to obtain logcat output without root programatically
Upvotes: 1