Writing

Making a Flutter app's crash reports worth reading

Making a Flutter app's crash reports readable: two reporters with separate jobs, a narrow filter, logs as breadcrumbs, and a logger trap in release builds.

· 4 min read· flutter, reliability, sentry, crashlytics

A crash dashboard is only useful if the real crash is the first thing on it. In Third Wave Coffee’s ordering app, Crashlytics mixed production crashes with errors from debug builds and layout-overflow warnings. A real failure could sit under a hundred lines of noise, and a dashboard like that trains people to stop looking.

This is how I cleaned it up in March 2026, what each piece costs, and where it stops.

Two reporters, two jobs

Crashlytics was already in the app. I added Sentry beside it rather than replacing it, because each is better at something.

  • Crashlytics gets native crashes through its Android and iOS SDKs, and Flutter framework errors through a handler the app controls. It has no Flutter web support, so the handler skips it there.
  • Sentry wraps the app at start-up and catches framework errors and uncaught async errors on every platform, web included. It also receives the app’s own logs, which turns out to matter most.

The cost is two dashboards that never agree exactly. I come back to that at the end.

A narrow filter in front of Crashlytics

Every framework error passes through one function before it reaches Crashlytics:

FlutterError.onError = (details) {
  if (kDebugMode) return;                 // a developer's broken screen is not a production crash
  if (isLayoutOverflow(details)) return;  // "RenderFlex overflowed"

  FirebaseCrashlytics.instance.recordFlutterFatalError(details);
};

The debug check does most of the work. Strictly, it also covers overflow: Flutter reports overflow from inside an assert, and release builds strip asserts. I kept the overflow rule anyway, because it states a decision instead of relying on a framework detail.

The overflow rule matches on message text, which is brittle: if Flutter rewords the message, the rule stops matching. But it fails in the safe direction. The noise comes back and nothing real is hidden. That is the property I want from any filter: match one narrow case, never drop a whole exception type.

Whatever gets through is recorded as fatal, so it sits with the native crashes instead of in a separate list nobody reads.

Logs as breadcrumbs

A stack trace says where the app died, not how it got there. The app already logged through one small wrapper around the logger package, so I gave that wrapper a second output: every log becomes a Sentry breadcrumb, and errors become events.

class SentryOutput extends LogOutput {
  SentryOutput(this.source);
  final String source;

  @override
  void output(OutputEvent event) {
    final message = event.origin.message.toString(); // raw message, not the printed lines
    final level = toSentryLevel(event.level);

    Sentry.addBreadcrumb(Breadcrumb(message: message, category: source, level: level));
    if (event.level >= Level.error) {
      Sentry.captureMessage('[$source] $message', level: level);
    }
  }
}

It reads the raw message on purpose. The console printer wraps each line in colour codes for the terminal, and those would land in Sentry as garbage.

The trap: logs that vanish in release

One setting decides whether any of this works in production. The logger package’s default filter only lets messages through when asserts are on, so in a release build it drops everything, including what was meant for Sentry. Debug builds report; release builds stay silent. That is exactly backwards, and nothing warns you.

Choose the filter and the threshold yourself:

Logger(
  filter: ProductionFilter(), // the default filter only runs with asserts on
  level: kReleaseMode ? Level.warning : Level.trace,
  output: MultiOutput([
    if (!kReleaseMode) ConsoleOutput(),
    SentryOutput(source),
  ]),
);

Release builds then send warnings and errors to Sentry and print nothing to the device console.

Environments, not a second filter

The filter above guards Crashlytics only. Sentry sees debug-build errors too, and keeps them apart differently: it tags every event with an environment from the build mode and a release from the app’s version and build number. Filtering the issue list to production hides the rest, with no extra code in the app.

Where it stops

A filter fixes nothing on its own. It makes sure that when something real breaks, it is the first thing anyone sees.

The two reporters still see different sets of errors: Crashlytics sees filtered framework errors and native crashes, Sentry sees everything Dart throws, split by environment. If I set this up again, one filter function would sit in front of both, in the Crashlytics handler and in Sentry’s beforeSend.

If you are setting this up

  • Decide what each reporter is for before adding a second one.
  • Filter narrowly, and make every rule fail towards showing noise, not hiding crashes.
  • Send your logs as breadcrumbs, and check that release builds actually send them.
  • Tag every event with its environment and release.
  • Upload symbol files with every build, or obfuscated stack traces point at nothing.

Written by Advait Bhitkar, mobile engineer. If this was useful, or wrong,email me.