Cette révision appartient à :
Daniel Seifert 2024-12-23 16:08:37 +01:00
Parent dad34c0b61
révision aa5b095b6e

Voir le fichier

@ -1,6 +1,15 @@
# Sensitive Message Formatter # Sensitive Message Formatter
A message formatter for Guzzles log middleware. It replaces static sensitive data (e.g. credentials). A message formatter for Guzzles log middleware. It replaces static sensitive data (e.g. credentials) in the whole log item.
From:
```
[2024-12-24 18:00:00] Logger.INFO: POST https://api.google.com/account/login HTTP/1.1 username=myUsername&password=mySecretPassword RESPONSE: 200 - {"sessid":"fv0Krhl...
```
To:
```
[2024-12-24 18:00:00] Logger.INFO: POST https://api.google.com/account/login HTTP/1.1 username=**********&password=**************** RESPONSE: 200 - {"sessid":"fv0Krhl...
```
## Installation ## Installation
@ -16,7 +25,7 @@ $stack->push(
$myLogger, $myLogger,
new sensitiveMessageFormatter( new sensitiveMessageFormatter(
'{method} {uri} {req_body} - RESPONSE: {code} - {res_body}', '{method} {uri} {req_body} - RESPONSE: {code} - {res_body}',
['myUser', 'myPassword'] ['myUsername', 'mySecretPassword']
) )
), ),
Logger::INFO Logger::INFO