Repository navigation
v0.3.0
Added
- Logging for Laravel's
Httpfacade (and any Guzzle client) with theHttpLogger::middleware()
Guzzle middleware: register it globally (Http::globalMiddleware(...)) or per client
(Http::withMiddleware(...)), add properties per middleware or per call (log_contextoption),
and adjust options such as messages. Logs requests, responses, connection failures (including
async and pooled requests and handlers that throw), retries and redirects, shares the trace id
with incoming requests, and logs once even if registered twice.
Security
- Fixed: the first query parameter of a URL inside free text (e.g. the URL Guzzle appends to
connection errors:... for https://host/?api_key=...) was not masked since 0.2.0.
Usage:
Http::globalMiddleware(HttpLogger::middleware()); // every Http:: call
Http::withMiddleware(HttpLogger::middleware(['supplier' => 'ratehawk'])) // some calls
->withOptions(['log_context' => ['action' => 'book']]) // per call
->post($url, $payload);Upgrading from 0.2.0 is recommended because of the masking fix above.
Full changelog: v0.2.0...v0.3.0