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
  • Integrating into a framework
  • Attribute providers
  • Application lifecycle
  • Censoring collected data
  • Ignoring collected data
  • Flare daemon
  • Errors
  • Adding custom context
  • Customise error report
  • Customising error grouping
  • Handling errors
  • Linking to errors
  • Reporting errors
  • Logs
  • Introduction
  • Levels
  • With errors
  • Performance
  • Introduction
  • Sampling
  • Limits
  • Modify spans and events
  • Data Collection
  • Application info
  • Cache events
  • Console commands
  • Database transactions
  • Dumps
  • Errors when tracing
  • Exception context
  • External http requests
  • Filesystem operations
  • Git information
  • Glows
  • Identifying users
  • Jobs and queues
  • Queries
  • Redis commands
  • Requests
  • Routing
  • Server info
  • Spans
  • Stacktrace arguments
  • Views
  • Older Packages
  • Flare Client PHP V2
  • Flare Client PHP V1

Levels

Flare uses Monolog log levels throughout its logging system. The following levels are available, from most to least severe:

Level Description
Level::Emergency System is unusable
Level::Alert Action must be taken immediately
Level::Critical Critical conditions
Level::Error Error conditions
Level::Warning Warning conditions
Level::Notice Normal but significant condition
Level::Info Informational messages
Level::Debug Debug-level messages

When you set a minimal log level, only logs at that level or above (more severe) will be collected.

Where log levels can be configured

There are two places where you can configure log levels, each controlling a different part of the logging system.

Standalone log shipping

When enabling log collection, you can set a minimal level for logs that are shipped to Flare as standalone entities:

use Monolog\Level;

$config->log(true, minimalLevel: Level::Warning);

When set, only logs at Warning or above will be sent to Flare. When null (the default), all log levels are sent.

This is the primary level gate. If a log doesn't pass this threshold, it won't be recorded at all, meaning it also won't be available for inclusion with error reports.

Monolog handler

When using the FlareLogHandler with a Monolog logger instance, you can set the handler's level threshold:

$monolog->pushHandler(new FlareLogHandler($flare->logger, Level::Warning));

This acts as a gate before logs reach the Flare logger. By default, the handler accepts all levels (Level::Debug).

Logs with errors

When an error occurs, recent log entries are included alongside the error report. You can set a separate minimal level for these logs:

use Monolog\Level;

$config->collectLogsWithErrors(
    minimalLevel: Level::Warning,
);

The default level is Level::Info. This level only filters logs that were already recorded by the logger, it cannot include logs that were filtered out by the standalone log level.

How the levels interact

The standalone log level is the primary gate. It determines which logs are recorded at all. The logs-with-errors level is a secondary filter that only applies when attaching logs to error reports.

For example, if you set the standalone level to Level::Warning and the logs-with-errors level to Level::Info, the logs-with-errors level has no effect, Info logs were never recorded in the first place.

As a rule of thumb: the logs-with-errors minimal level should always be equal to or higher than the standalone log level.

Introduction With errors
  • On this page
  • Where log levels can be configured
  • How the levels interact

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