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

Installation

You can install the Flare client as follows:

composer require spatie/flare-client-php:^2.0

Next, initialise the client in your project:

use Spatie\FlareClient\Flare;

$flare = Flare::make('YOUR-API-KEY')->registerFlareHandlers();

Great! From now on, Flare will track all errors and exceptions throughout your application.

Configuring Flare

It is possible to configure the Flare client to suit your needs. You can do this by creating a Flare config object:

use Spatie\FlareClient\FlareConfig;

$config = FlareConfig::make('YOUR-API-KEY');

$flare = Flare::make($config)->registerFlareHandlers();

In the next pages we will discuss the different configuration options available to you, methods you can call on the config object will always be using the $config variable, methods that should be called on the Flare object will be using the $flare variable.

Setting the application root path

We recommend that you set the application root path. This will help Flare determine the correct file paths in your stack traces.

$config->applicationPath('/path/to/your/application/root');
Introduction Censoring collected data
  • On this page
  • Configuring Flare
  • Setting the application root path

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