Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[HttpClient] Implemented LoggerAwareInterface in HttpClientInterface decorators#54668
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
[HttpClient] Implemented LoggerAwareInterface in HttpClientInterface decorators#54668
Uh oh!
There was an error while loading.Please reload this page.
Conversation
nicolas-grekas commentedApr 19, 2024
Can you please do the same for all decorators? I see that others could need that change. |
1 similar comment
nicolas-grekas commentedApr 19, 2024
Can you please do the same for all decorators? I see that others could need that change. |
yann-eugone commentedApr 19, 2024
@nicolas-grekas sure, just did :7f2fe9b |
Uh oh!
There was an error while loading.Please reload this page.
7f2fe9b toc2a7b73Comparenicolas-grekas commentedApr 19, 2024
Thank you@yann-eugone. |
yann-eugone commentedApr 19, 2024
Happy to help 🙂 |
fabpot commentedMay 2, 2024
Reverted in#54674 |
Uh oh!
There was an error while loading.Please reload this page.
Implement
Psr\Log\LoggerAwareInterfaceinSymfony\Component\HttpClient\UriTemplateHttpClient.I was on a journey to enhance our logs on a project that highly depend on
HttpClient.I started to separate logs per feature, and I wanted to include
HttpClientlogs to the logger of the currently running the feature.I figured out that most implementations of
HttpClientInterfaceare implementingLoggerAwareInterface, so I decided to just call$client->setLogger(...)on my side.Andnothing changed.
Nothing changed because my logger is decorated by the
UriTemplateHttpClientthat is not implementingLoggerAwareInterface.Althought
UriTemplateHttpClienthas no need of a logger, as a decorator it should be able to act like it, so the underlying client can be reached.This is what is done for instance in
Symfony\Component\HttpClient\TraceableHttpClient.