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 Svelte Svelte Protocol Protocol
  • General
  • Installation
  • Resolving bundled code
  • API reference
  • Errors
  • Reporting errors
  • Client hooks
  • Logs
  • Introduction
  • Levels
  • Attributes
  • Data Collection
  • Adding custom context
  • Adding glows

Attributes

Every log method accepts an optional second argument: an object of structured attributes attached to that single log entry. Use it to record the data that makes a log message useful to search and filter on later.

flare.logger.info('Order placed', {
    orderId: 'ord_8231',
    total: 49.99,
    currency: 'EUR',
    items: 3,
});

Attribute values can be strings, numbers, booleans, null, arrays, or nested objects:

flare.logger.warning('Validation failed', {
    field: 'email',
    errors: ['required', 'invalid_format'],
    context: { formId: 'signup', step: 2 },
});

How attributes are handled

Attributes are frozen at the moment you record the log. The client encodes them immediately, so later changes to the original object don't affect the buffered entry. Pass the values you want captured at call time.

Attributes you set on a log entry apply only to that entry. They are not shared with other logs or with error reports.

Service-wide identity

Set serviceName once through configuration to attach it to every log batch (sent as service.name), rather than passing it per-call:

flare.configure({
    enableLogs: true,
    serviceName: 'storefront',
});
Levels Adding custom context
  • On this page
  • How attributes are handled
  • Service-wide identity

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