With errors
By default, when an error occurs, recent log entries are included alongside the error report. This gives you context about what happened before the error. This works automatically and does not require the standalone log shipping feature to be enabled.
You can configure the maximum number of logs tracked and disable this feature in the collects key of your config/flare.php file.
To disable logs with errors:
use Spatie\FlareClient\Enums\CollectType;
'collects' => FlareConfig::defaultCollects(
ignore: [CollectType::LogsWithErrors],
),
To configure the maximum number of logs collected with errors:
use Spatie\FlareClient\Enums\CollectType;
'collects' => FlareConfig::defaultCollects(
extra: [
CollectType::LogsWithErrors->value => [
'max_items_with_errors' => 10,
],
]
),