Sending logs to Flare
In addition to handling your application errors, you may also want to send specific error messages to Flare.
These error messages are not necessarily errors but log statements that exceed a specified threshold—think of critical logs that your application sends and that you want to be notified about.
Activating/Deactivating log reporting
In your flare.php config file, you can enable or disable log reporting. The send_logs_as_events
key determines whether Flare should receive your error logs automatically.
Controlling the minimum log level to report
By default, we only collect logs that are at least of the type "Error" or above (Emergency, Critical). That means we do not receive simple info logs you perform in your application.
You can modify the minimum report log level by specifying it by adding or modifying the level
key in your logging channel configuration.
For example, this would restrict logs to being sent to Flare only when they are at the "critical" level.
// in your config/logging.php
'flare' => [
'driver' => 'flare',
'level' => 'critical',
],
This would mean that the following log calls would be sent to Flare:
Log::critical('Something went wrong');
Log::alert('Something went wrong');
Log::emergency('Something went wrong');
But these log calls would not be sent to Flare:
Log::debug('Something went wrong');
Log::info('Something went wrong');
Log::notice('Something went wrong');
Log::warning('Something went wrong');
Log::error('Something went wrong');