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

Laravel Vapor

Flare will work out of the box with Laravel Vapor. However, there are a few things to keep in mind when using Flare with Vapor.

In normal server setups, Flare registers a hook into PHP to send all errors and traces at the end of the request. This ensures that your application will not be slowed down by sending errors and traces to Flare.

However, in a serverless environment like Vapor, the PHP process is frozen after the request has been handled. This means that the hook that Flare registers will not be called.

Laravel Vapor solves this by executing the hook before the request is finished, which can slow down your application quite a lot.

In order to solve this issue, you can configure Flare to send traces and logs using a job on the queue instead of sending them at the end of the request. You can do this by changing the sender in your config/flare.php file:

'sender' => [
    'class' => \Spatie\LaravelFlare\Senders\LaravelVaporSender::class,
    'config' => [],
],

By default, traces and logs will be sent using a job, while errors will still be sent at the end of the request. You can configure this per entity type:

'sender' => [
    'class' => \Spatie\LaravelFlare\Senders\LaravelVaporSender::class,
    'config' => [
        'queue_errors' => false,  // default: false (errors sent immediately)
        'queue_traces' => true,   // default: true
        'queue_logs' => true,     // default: true
    ],
],

Errors stay synchronous by default so a fatal error still reports even when the queue worker is unavailable. Traces and logs are far more frequent and tolerate the small delay queued delivery introduces.

It is possible to define the connection and queue name that should be used to dispatch the job. You can do this by adding the connection and queue keys to the sender configuration:

'sender' => [
    'class' => \Spatie\LaravelFlare\Senders\LaravelVaporSender::class,
    'config' => [
        'connection' => 'sqs',
        'queue' => 'flare',
    ],
],

If you want to configure the sender which will be called by the LaravelVaporSender, you can do so by adding the sender and sender_config keys to the sender configuration:

'sender' => [
    'class' => \Spatie\LaravelFlare\Senders\LaravelVaporSender::class,
    'config' => [
        'sender' => \Spatie\FlareClient\Senders\CurlSender::class,
        'sender_config' => [
            'curl_options' => [
                CURLOPT_SSL_VERIFYHOST => 0,
                CURLOPT_SSL_VERIFYPEER => 0,
            ],
        ],
    ],
],

Test payloads

php artisan flare:test always sends test payloads synchronously, regardless of the queue_* flags above. This way the command can report success or failure based on Flare's actual response instead of just confirming the job was queued.

Logging

If you have logging enabled, set up the flare log channel through a vapor stack alongside stderr so Vapor's log forwarding still picks up entries even when log shipping itself is queued. The logs introduction shows the channel configuration.

Laravel Octane Introduction
  • On this page
  • Test payloads
  • Logging

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