-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Closed
Labels
Description
Description
Hi,
Using HttpClient i found no way to;
- log (masked) request bodies/headers for eg. urls matching X
- log (masked) response bodies/headers eg. based on status code X and/or corresponding request
- determine a log level based on response/request
- determine the log channel (but i guess this is matter of manually calling
CurlHttpClient::setLogger
, but AFAIK it can't be wired using framework configuration)
Is there a way to achieve this currently?
At the moment we rely on https://github.com/php-http/logger-plugin, but i'd like to do it with Symfony HTTP Client, rather than having one HTTP client decorate another.
It should be noted this decoration approach (httplug => sfclient) creates double logs, somewhat by default. Luckily we only persist the specific channel in the outer client, not the http_client
channel. However during console logs (-vv) things are super weird :)
Example
No response
Gemorroj, qdequippe and pbowyer