align README

This commit is contained in:
Daniel Seifert 2024-12-23 16:08:37 +01:00
bovenliggende dad34c0b61
commit aa5b095b6e

Bestand weergeven

@ -1,6 +1,15 @@
# 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
@ -16,7 +25,7 @@ $stack->push(
$myLogger,
new sensitiveMessageFormatter(
'{method} {uri} {req_body} - RESPONSE: {code} - {res_body}',
['myUser', 'myPassword']
['myUsername', 'mySecretPassword']
)
),
Logger::INFO