Flare by Spatie
    • Error Tracking
    • Performance Monitoring
    • Logs Coming soon
  • Pricing
  • Docs
  • Insights
  • Changelog
  • Back to Flare ⌘↵ Shortcut: Command or Control Enter
  • Sign in
  • Try Flare for free
  • Error Tracking
  • Performance Monitoring
  • Logs Coming soon
  • Pricing
  • Docs
  • Insights
  • Changelog
    • Back to Flare ⌘↵ Shortcut: Command or Control Enter
    • Try Flare for free
    • Sign in
Flare Flare Laravel Laravel PHP PHP JavaScript JavaScript React React Vue Vue Protocol Protocol
  • General
  • Installation
  • Censoring collected data
  • Ignoring collected data
  • Flare daemon
  • Laravel Octane
  • Laravel Vapor
  • Errors
  • Introduction
  • Customise error report
  • Customising error grouping
  • Linking to errors
  • Logs
  • Introduction
  • Levels
  • With errors
  • Performance
  • Introduction
  • Sampling
  • Limits
  • Modify spans and span events
  • Data Collection
  • Application info
  • Cache events
  • Console commands
  • Custom context
  • Database transactions
  • Dumps
  • Errors when tracing
  • Exception context
  • External http requests
  • Filesystem operations
  • Git information
  • Glows
  • Identifying users
  • Jobs and queues
  • Laravel context
  • Livewire
  • Queries
  • Redis commands
  • Requests
  • Server info
  • Spans
  • Stacktrace arguments
  • Views
  • Older Packages
  • Laravel Flare V2
  • Laravel Flare V1
  • Ignition

Introduction

Flare collects errors and exceptions thrown in your Laravel application and ships them to flareapp.io, together with everything we know about the moment they happened.

If you haven't installed the client yet, start with the installation guide.

How errors get to Flare

The Laravel client hooks into Laravel's exception handler automatically, so most of the time you don't need to do anything. Any unhandled exception is reported to Flare for you.

Registering manually

If you have customised Laravel's exception handling and want to make sure Flare receives reports, register it explicitly in bootstrap/app.php:

use Spatie\LaravelFlare\Facades\Flare;

->withExceptions(function (Exceptions $exceptions) {
    Flare::handles($exceptions);
})

Flare::handles() wires Flare into Laravel's Exceptions configuration so every reportable throwable is also sent to Flare.

Reporting manually

When you catch a throwable yourself, use Laravel's report() helper:

try {
    // ...
} catch (Throwable $exception) {
    report($exception);
}

Errors reported this way are marked as handled in Flare, so you can filter them out separately from unhandled crashes.

PHP errors

PHP defines two kinds of things that can go wrong: exceptions, and errors (notices, warnings, fatal errors, and so on). The Flare client wraps PHP errors into ErrorException instances and reports them the same way as exceptions.

By default, every error level is sent to Flare. You can narrow that down through the report_error_levels key in config/flare.php:

'report_error_levels' => E_ALL & ~E_NOTICE,

Set the value to null to send every error level. Throughout the documentation, the word "error" covers both exceptions and PHP errors.

Data collection with errors

Each error report carries a lot of contextual data on top of the stacktrace (the request, the route, queries that ran during the request, recent logs, the authenticated user, and more). Most of it is collected for you, and you can extend or strip it where needed. The data collection section covers every collector in detail. A few that are especially useful around errors:

  • Custom context. Attach key/value data that applies to every error and log.
  • Laravel context. Anything stored via Laravel's Context facade is automatically attached.
  • Exception context. Attach context to a specific exception class.
  • Identifying users. Attach the authenticated user to a report.
Laravel Vapor Customise error report
  • On this page
  • How errors get to Flare
  • Data collection with errors

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

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