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

Logs

Flare can collect information about the logs being written in your application. This includes:

  • The log level
  • The log message
  • The log context

This functionality is enabled by default, but you can disable it by calling ignoreLogs() on the Flare config:

$config->ignoreLogs();

You can configure the maximum number of logs tracked while collecting data in the case of an error as follows:

$config->collectLogs(maxItemsWithErrors: 10);

Collecting logs

We cannot automatically collect logs in the framework-agnostic version of the package. You can manually add logs as such:

use Spatie\FlareClient\Enums\MessageLevels;

$flare->log()->record(
    message: 'This is a log message',
    level: MessageLevels::Debug,
    context: [
        'team_id' => 1
    ]
);

The MessageLevels enum follows the RFC5424 standard. The following levels are available:

Level Description
MessageLevels::Emergency Emergency: system is unusable
MessageLevels::Alert Alert: action must be taken immediately
MessageLevels::Critical Critical: critical conditions
MessageLevels::Error Error: error conditions
MessageLevels::Warning Warning: warning conditions
MessageLevels::Notice Notice: normal but significant condition
MessageLevels::Informational Informational: informational messages
MessageLevels::Debug Debug: debug-level messages
Identifying users Queries
  • On this page
  • Collecting logs

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