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
  • Errors
  • Adding custom context
  • Customising error grouping
  • Handling errors
  • Linking to errors
  • Reporting errors
  • 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

Adding custom context

When you send an error to Flare, we might not collect essential application information.

To provide more information, you can add custom context to your application, which will be sent along with every error that occurs in your application. This can be very useful if you want to provide key-value-related information that further helps you debug a possible error.

The Flare client allows you to set custom context items like this:

// Get access to your registered Flare client instance
$flare->context('tenant', 'My-Tenant-Identifier');

So, the next time an exception occurs, this value will be sent along to Flare, and you can find it in the "Context" section.

It is also possible to send multiple context items at once:

$flare->context([
    'tenant_id' => 'My-Tenant-Identifier',
    'tenant_name' => 'My-Tenant-Name'
]); 
Ignoring collected data Customising error grouping

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