Sending logs to Flare
In addition to handling your application exceptions, you might sometimes also want to send specific error messages to Flare.
These error messages are not necessarily exceptions, but simply log statements that exceed a specified threshold - think of critical logs that your application sends and you want to get notified about them.
Activating/Deactivating log reporting
You can enable or disable log reporting in your flare.php
config file. The send_logs_as_events
key determines whether or not Flare should automatically receive your error logs.
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 that we do not receive simple info logs that you perform in your application.
You can modify the minimum report log level by specifying it by adding or modifying the the level
key in your logging channel configuration.
For example, this would restrict logs to only be sent to Flare 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 this 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');