Add the ability to automatically remove PII from logs #51906
Replies: 2 comments 7 replies
-
Hi.
from the model does not suit this? Like:
|
Beta Was this translation helpful? Give feedback.
-
Log::redact('name', 'email'); The thing that concerns me about a one-size-fits-all "redact any key with this name" approach is it sanitizes too much data. Log::debug('Fetched events from https://my-events.api: {events}', ['events' => [['id' => 1, 'name' => 'Meetup']]]); In context, the name key isn't sensitive information and I wouldn't expect it to be redacted here. That said, since Laravel is using Monolog for its log handling, there's really not much of a need to add this to the framework. There's a package at https://github.com/leocavalcante/redact-sensitive which provides a Monolog processor that looks to be able to do what you want in the way you're trying to accomplish it. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
It would be great if we could have some way to remove PII from log context automatically by specifying keys that we don't want to have shown. Being able to register in a config or service provider specific keys that should be omitted and then turn the redacting feature on or off for each channel would be killer. The idea would be if I have it turned on for my channel when I do:
the output in the log would be like:
More than happy to open a PR for this but thought I'd see if it's welcome first or not.
Beta Was this translation helpful? Give feedback.
All reactions