Logs · Plans and data
Data and privacy
A log line can hold anything your app writes, so the SDK takes personal data out before a line leaves your server, and Logs does it again on arrival.
What Logs keeps
Loading what it keeps…
What is taken out in your app
Before a line is written to the spool, the SDK runs these patterns over its message, every string of its context and extra, their keys, and what was running:
| What | Becomes |
|---|---|
| Email addresses | [email] |
| IBANs, with or without spaces | [iban] |
| Finnish personal identity codes | [hetu] |
| Bearer tokens | Bearer [token] |
| Strings of 40 or more letters and digits: API keys, long secrets | [token] |
| Phone numbers that start with + or 0, such as +358 40 123 4567 or 040-1234567 | [phone] |
- Secret-looking keys. A value under a key that contains
password,passwd,secret,token,api_key,apikey,authorization,cookie,private_key,card_number,cvvorcvc, in any case and with-or_, goes whole: it is sent as[redacted], whatever it holds. - Models. An Eloquent model in the context is sent as its class and key, never its attributes.
- Exceptions. An exception is its class, message, code, place and trace, with the message scrubbed. Your app's paths are sent relative to its root.
Rules of your own
Patterns of your own go under scrub in config/mybeast-logs.php (publish it with php artisan vendor:publish --tag=mybeast-logs-config). Each is a regular expression and what to put in its place; one that doesn't compile is left out.
// config/mybeast-logs.php
'scrub' => [
'/\bCUST-\d{6}\b/' => '[customer]',
],For what a pattern can't say, give the SDK a function. It runs on every text after the built-in patterns and yours:
// A service provider's boot()
use MyBeast\Logs\Laravel\Facades\Logs;
Logs::scrubUsing(fn (string $text): string => PersonalIdentityCode::maskIn($text));Scrubbed again on arrival
Logs runs the same built-in patterns and secret-looking keys over every line it takes in, whoever sent it, so a line sent to the API without the SDK is scrubbed too. Your own rules run in your app only: an app that sends without the SDK must scrub what they would.
Who read what
Reading lines is written down in the project's audit log: each search for a text or a request id, and each opening of a request's lines, with who did it. So is every change to how long lines are kept. Paging on through a search and watching the live view aren't.
Erasing a person's data
Logs has no way to delete one line. Lines go by age: every hour, those older than their environment keeps them are deleted. To erase a person's data sooner, lower the number of days of the environment that holds it, as Choose how long lines are kept shows. Its older lines are deleted within the hour, and you can set the number back after.
It deletes every older line
For a request you can't answer that way, write to us: we help you answer people who use their data protection rights, as our data processing terms say.