Dima Portenko
Dima Portenko

Reputation: 3844

React Native collect logs remote

I want to log errors from catch statements, like

try {
  ...
} catch (error) {
  logError(error);
}

or

...
.then()
.catch (error) {
  logError(error);
}

I've tried to use https://appcenter.ms analytics for this purpose like this

import Analytics from 'appcenter-analytics';

export const logError = (error) => {
  const date = new Date();
  const properties = { error: `${date} ${error.message}`, stacktrace: `${date} ${error.stack}` };
  if (error && error.response && error.response.data) {
    properties.response = `${date} ${error.response.data.toString()}`;
  }
  Analytics.trackEvent('Error', properties);
};

But app center shows me only the top 10 repeated events, which is not really useful for me.

Are there any common practices and solutions for such purpose? The only service I've found from my searches is https://bugfender.com/.

Upvotes: 2

Views: 3607

Answers (3)

Abel Wenning
Abel Wenning

Reputation: 652

Additional options:

Upvotes: 1

Prem Govind
Prem Govind

Reputation: 1

Also, there is NewRelic. Their implementation is not as straightforward IMO as that of Sentry or others (if you are using react-native to build your app), but their dashboards and the information and KPIs they are collecting is pretty impressive.

Upvotes: 0

Dima Portenko
Dima Portenko

Reputation: 3844

I started using Bugfender and find it quite nice. I think I'll keep collecting all solutions I'll find in this answer

  1. Bugfender
  2. Bugsnag
  3. Sentry

Upvotes: 7

Related Questions