Controlling collected data
You have full control over what data should get collected and sent to Flare.
Flare middleware will add information to the report that is sent to Flare. You can disable and configure middlewares in the flare
config file.
Anonymizing IPs
By default, Flare does not collect and send information about the IP address of your application users. If you want to collect this information, you can remove the RemoveRequestIp
middleware.
Censoring request body/header fields
When an exception occurs in a web request, the Flare client will pass on request fields that are present in the body. By default, Flare will replace the value any fields that are named "password" with "<CENSORED>".
To censor out values of additional fields, you put the names of those fields in the config of the CensorRequestBodyFields
middleware:
// config/flare.php
return [
// ...
'flare_middleware' => [
CensorRequestBodyFields::class => [
'censor_fields' => [
'password',
'password_confirmation',
'other_field',
],
],
// ...
],
]
It is also possible to censor out values of request headers. You can do this by adding the headers
key to the CensorRequestHeaders
middleware:
// config/flare.php
return [
// ...
'flare_middleware' => [
CensorRequestHeaders::class => [
'headers' => [
'Authorization',
'Other-Header',
],
],
// ...
],
]
Git information
By default, Flare collects the current commit hash, the commit message as well as the repository URL so that you can easily link an exception with the commit hash that was checked out on your deployed application.
If you wish to disable this information, you can remove the AddGitInformation
middleware.
Environment information
Flare collects information about your environment, such as the PHP version, the Laravel version and the server information. If you wish to disable this information, you can remove the AddEnvironmentInformation
middleware.
Dumps
Flare automatically collects all of your executed dumps that happened before the exception occurred. If you want to disable this, you can remove the AddDumps
middleware.
Logs
Flare automatically collects all of your logs that happened before the exception occurred. If you want to disable this, you can remove the AddLogs
middleware.
Jobs
Flare logs executed jobs and their payload. If you want to disable this, you can remove the AddJobs
middleware.
SQL Queries
Flare automatically collects all of your executed queries that happened before the exception occurred. If you want to disable this, you can remove the AddQueries
middleware.
The bindings of the queries are also collected by default. If you want to disable this, you can set the report_query_bindings
key to false
.
Users
When a user is logged in to your Laravel application and an error occurs then a copy of the user model is sent to Flare.
You can hide certain properties by adding them to the $hidden property of your model or by implementing a toFlare
method on the model:
class User extends BaseUser
{
public function toFlare()
{
return [
'name' => $this->name,
'email' => $this->email
];
}
}