Flare by Spatie
    • Error Tracking
    • Performance Monitoring
  • Pricing
  • Docs
  • Insights
  • Changelog
  • Back to Flare
  • Sign in
  • Try Flare for free
  • Error Tracking
  • Performance Monitoring
  • Pricing
  • Docs
  • Insights
  • Changelog
    • Back to Flare
    • Try Flare for free
    • Sign in
Flare Flare Laravel Laravel PHP PHP JavaScript JavaScript
  • General
  • Introduction
  • Installation
  • Censoring collected data
  • Ignoring collected data
  • 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 events
  • Data Collection
  • Application info
  • Application lifecycle
  • 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
  • Logs
  • Queries
  • Redis commands
  • Requests
  • Routing
  • Server info
  • Solutions
  • Spans
  • Stacktrace arguments
  • Views
  • Older Packages
  • Flare Client PHP V1

Exception context

Flare can collect extra context information added to an exception as such:

use Exception;
use Spatie\FlareClient\Contracts\ProvidesFlareContext;

class ExceptionWithContext extends Exception implements ProvidesFlareContext
{
    public function context(): array
    {
        return [
            'key' => 'value',
        ];
    }
}

The context will be collected automatically when the exception is thrown.

Errors when tracing External http requests

Track errors and fix slowdowns with Flare, the full-stack application monitoring platform for Laravel, PHP & JavaScript.

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