Flare by Spatie
  • Features
  • Pricing
  • Docs
  • Blog
  • LOG IN
  • START TRACKING
  • Home
  • Features
  • Pricing
  • Docs
  • Blog
    • Try Flare for free
    • Sign in
Flare Flare Laravel Laravel PHP PHP JavaScript JavaScript
  • General
  • Introduction
  • Installation
  • Censoring collected data
  • Ignoring collected data
  • Laravel Octane
  • Errors
  • Adding custom context
  • Customising error grouping
  • Handling errors
  • Linking to errors
  • Reporting errors
  • Sending logs to Flare
  • Performance
  • Introduction
  • Sampling
  • Limits
  • Modify spans and span events
  • Data Collection
  • Application info
  • Cache events
  • Console commands
  • Customise error report
  • Database transactions
  • Dumps
  • Errors when tracing
  • Exception context
  • External http requests
  • Filesystem operations
  • Git information
  • Glows
  • Identifying users
  • Jobs and queues
  • Laravel context
  • Livewire
  • Logs
  • Queries
  • Redis commands
  • Requests
  • Server info
  • Solutions
  • Spans
  • Stacktrace arguments
  • Views
  • Older Packages
  • Laravel Flare V1
  • Ignition

Customise grouping

Flare has a unique grouping algorithm that groups similar error occurrences into errors to make understanding what's going on in your application easier.

While the default grouping algorithm works for 99% of cases, there are some cases where you might want to customise it.

This can be done on an exception class basis. You can tell Flare to group all exceptions of a specific class together by setting the following in the flare.php config file:

use Spatie\FlareClient\Enums\OverriddenGrouping;

// flare.php config file

'overridden_groupings' => [
    SomeExceptionClass::class => OverriddenGrouping::ExeptionClass,
],

In this case, every exception of the SomeExceptionClass will be grouped together, regardless of the message or stack trace.

It is also possible to group exceptions of the same class together, but also take the message into account:

use Spatie\FlareClient\Enums\OverriddenGrouping;

// flare.php config file

'overridden_groupings' => [
    SomeExceptionClass::class => OverriddenGrouping::ExceptionMessageAndClass,
],

Be careful when grouping by class and message. Since every occurrence might have a slightly different message, this could lead to many different errors.

Adding custom context Handling errors

Monitor your web apps and sites from errors to slowdowns with Flare, the easiest application monitoring platform for Laravel, PHP & Javascript.

  • Platform
  • Error Tracking
  • Performance Monitoring
  • Pricing
  • Support
  • Resources
  • Blog
  • Changelog
  • Documentation
  • Affiliate program
  • Service status
  • Terms of use
  • DPA
  • Privacy & Cookie Policy
Flare