Flare by Spatie
    • Error Tracking
    • Performance Monitoring
    • Logs
  • Pricing
  • Docs
  • Blog
  • Changelog
  • Back to Flare ⌘↵ Shortcut: Command or Control Enter
  • Sign in
  • Try Flare for free
  • Error Tracking
  • Performance Monitoring
  • Logs
  • Pricing
  • Docs
  • Blog
  • Changelog
    • Back to Flare ⌘↵ Shortcut: Command or Control Enter
    • Try Flare for free
    • Sign in
Flare Flare PHP PHP JavaScript JavaScript Protocol Protocol
JavaScript
  • JavaScript
  • React
  • Vue
  • Svelte
  • Inertia
  • React Native
  • Electron
  • Getting Started
  • Introduction
  • Quick start
  • CDN installation
  • Errors
  • Reporting errors
  • Client hooks
  • Sourcemaps
  • Tracing
  • How tracing works
  • What gets traced
  • Web vitals
  • Manual spans
  • Sampling
  • Profiling
  • How component profiling works
  • Logs
  • Introduction
  • Levels
  • Attributes
  • Data Collection
  • Adding custom context
  • Adding glows
  • Automatic breadcrumbs
  • GDPR consent
  • Identifying users
  • Reference
  • API
  • Configuration

Levels

View as Markdown

Flare uses the standard syslog severity levels for logs. Each level has its own method on flare.logger. The following levels are available, from most to least severe:

Method Description
flare.logger.emergency(message, attributes?) System is unusable
flare.logger.alert(message, attributes?) Action must be taken immediately
flare.logger.critical(message, attributes?) Critical conditions
flare.logger.error(message, attributes?) Error conditions
flare.logger.warning(message, attributes?) Warning conditions
flare.logger.notice(message, attributes?) Normal but significant condition
flare.logger.info(message, attributes?) Informational messages
flare.logger.debug(message, attributes?) Debug-level messages
flare.logger.debug('Cache miss', { key: 'user:42' });
flare.logger.warning('Retrying request', { attempt: 2 });
flare.logger.critical('Payment provider unreachable');

Setting a minimum level

By default, every level is sent to Flare. Set minimumLogLevel to drop anything below a given severity:

flare.configure({
    enableLogs: true,
    minimumLogLevel: 'warning',
});

With the example above, only logs at warning or above (warning, error, critical, alert, emergency) are recorded. Calls to flare.logger.info() and flare.logger.debug() become no-ops.

Logs filtered out by minimumLogLevel are never buffered, so they cost nothing beyond the method call.

Introduction Attributes

On this page

  • Setting a minimum level

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
  • Blog
  • Newsletter
  • Changelog
  • Documentation
  • Affiliate program
  • uptime status badge Service status
  • Terms of use
  • DPA
  • Privacy & cookie Policy
Made in by Spatie logo
Flare