Closed timcosgrove closed 3 weeks ago
Pull into sprint 20.
This is what shows up for the drupal logs being passed to Datadog, note that it is only the uid NOT the username. This was taken from the logs from before we removed the default current_user
processor.
The update is a copy/paste of the default processor and replacing the username
part with the uid
where it is being made available even though only the uid
appears to be passed currently.
User Story or Problem Statement
In #19156, we removed Monolog's
current_user
processor, which was writing bothuid
andusername
information to log messages.username
is PII, butuid
is not. It is useful to be able to tie a log message back to the user whose actions resulted in the log message, so we should re-enableuid
.Description or Additional Context
The 'current_user' processor Monolog provides is here: https://git.drupalcode.org/project/monolog/-/blob/3.0.x/src/Logger/Processor/CurrentUserProcessor.php?ref_type=heads
This can almost certainly be used as a starting part for what we want. We specifically do not want to write email, username, or any other personally identifying information to the log; only user ID should be written.
The processor can be activated by adding it to a custom module's services. Example here: https://github.com/department-of-veterans-affairs/va.gov-cms/blob/main/docroot/modules/custom/va_gov_backend/va_gov_backend.services.yml#L47
Steps for Implementation
Acceptance Criteria