Flare Error tracking made for Laravel
Features Pricing Docs Log in Start free trial
  • Docs
  • Videos

Documentation

  • General

    • Welcome
    • Projects
    • Errors
    • Error occurrences
    • Sharing error occurrences
    • Spike protection
  • Ignition for Laravel

    • Installation
    • Configuration
    • Controlling collected data
    • Sending logs to Flare
    • Sharing errors
    • Identifying users
    • Adding custom context
    • Adding glows
    • Writing custom middleware
    • Adding custom tabs
    • First party extensions
    • Third party extensions
  • Flare for generic PHP projects

    • Installation
    • Controlling collected data
    • Identifying users
    • Adding custom context
    • Adding glows
    • Writing custom middleware
  • Javascript error tracking

    • Installation
    • Framework integrations
    • Adding custom context
    • Adding glows
    • Solution Providers
    • Resolving Bundled Code
  • Solutions

    • Introduction
    • Adding custom solutions
    • Making solutions runnable
    • Using solution providers
    • Writing good solutions
  • Notifications

    • Configuring notifications
    • Mail
    • Slack
    • SMS
    • Webhooks
  • Team management

    • Using multiple teams
    • Subscribing to a plan
    • Receiving invoices
    • Managing team members
    • Inviting guests to projects

Installation

To install Ignition in your Laravel application, install it as a dependency via composer:

composer require facade/ignition

In Laravel 6.0 that command will move facade/ignition from dev-dependencies to dependencies.

In Laravel 5.5, 5.6, 5.7 and older versions of 5.8 you will also need to modify your app/Exceptions/Handler.php file to load Ignition instead of the default Whoops page. Make sure to remove filp/whoops from your composer.json to avoid conflicts.

Add this method to your Handler.php file:

protected function whoopsHandler()
{
    try {
        return app(\Whoops\Handler\HandlerInterface::class);
    } catch (\Illuminate\Contracts\Container\BindingResolutionException $e) {
        return parent::whoopsHandler();
    }
}

Optionally, you can publish configuration files.

php artisan vendor:publish --provider="Facade\Ignition\IgnitionServiceProvider" --tag="ignition-config"

This will publish config/ignition.php.

php artisan vendor:publish --provider="Facade\Ignition\IgnitionServiceProvider" --tag="flare-config"

This will publish config/flare.php.

Sending errors to Flare

If you want to send errors to Flare, you must specify a valid API key in the key variable of the config file or as your FLARE_KEY environment variable. You can get an API key when creating a new project or by visiting the project settings screen for an existing project.

The package uses Laravel's logging system to send errors. You must configure your log stack to use the flare channel.

Here's an example where the flare channel has been added.

// in config/logging.php

return [
       'default' => env('LOG_CHANNEL', 'stack'),

       'channels' => [
           'stack' => [
               'driver' => 'stack',
               'channels' => ['daily', 'flare'],
               'ignore_exceptions' => false,
           ],
        ],
];

To test out if the package is configured correctly to send error you can use the test command:

php artisan flare:test

If there's something wrong with your configuration, the message should guide you towards the solution.

Using Flare on Vapor

Laravel Vapor changes your default logging configuration to the stderr channel, which is captured and logged by AWS CloudWatch.

You can add a new vapor channel using the stack driver that includes both the stderr and flare channels.

This is how it looks:

// in .env.production
LOG_CHANNEL=vapor

This is what it looks like:

// in config/logging.php

return [
       'channels' => [           
            'vapor' => [
                'driver' => 'stack',
                'channels' => ['flare', 'stderr'],
                'ignore_exceptions' => false,
            ],
            
            'flare' => [
                'driver' => 'flare',
            ],
        ],
];
Previous topic Next topic

On this page

  • Sending errors to Flare
  • Using Flare on Vapor

About Flare

  • Home
  • Features
  • Pricing
  • Support

Resources

  • Blog
  • Docs
  • Ignition
  • Videos

App

  • Log in
  • Start free trial
SPATIE
  • Service status
  • Terms of use
  • Privacy & cookie policy