Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[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

Conversation

@yann-eugone
Copy link
Contributor

@yann-eugoneyann-eugone commentedApr 19, 2024
edited
Loading

ImplementPsr\Log\LoggerAwareInterface inSymfony\Component\HttpClient\UriTemplateHttpClient.

QA
Branch?7.1
Bug fix?no
New feature?no
Deprecations?no
Issues
LicenseMIT

I was on a journey to enhance our logs on a project that highly depend onHttpClient.
I started to separate logs per feature, and I wanted to includeHttpClient logs to the logger of the currently running the feature.

I figured out that most implementations ofHttpClientInterface are implementingLoggerAwareInterface, so I decided to just call$client->setLogger(...) on my side.
Andnothing changed.

Nothing changed because my logger is decorated by theUriTemplateHttpClient that is not implementingLoggerAwareInterface.
AlthoughtUriTemplateHttpClient has 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 inSymfony\Component\HttpClient\TraceableHttpClient.

@carsonbotcarsonbot added this to the7.1 milestoneApr 19, 2024
@yann-eugoneyann-eugone changed the title[HttpClient] Add LoggerAwareInterface to UriTemplateHttpClient[HttpClient] Implement LoggerAwareInterface in UriTemplateHttpClientApr 19, 2024
@nicolas-grekas
Copy link
Member

Can you please do the same for all decorators? I see that others could need that change.

1 similar comment
@nicolas-grekas
Copy link
Member

Can you please do the same for all decorators? I see that others could need that change.

@yann-eugone
Copy link
ContributorAuthor

@nicolas-grekas sure, just did :7f2fe9b

@yann-eugoneyann-eugone changed the title[HttpClient] Implement LoggerAwareInterface in UriTemplateHttpClient[HttpClient] Implemented LoggerAwareInterface in HttpClientInterface decoratorsApr 19, 2024
@nicolas-grekasnicolas-grekasforce-pushed thelogger-aware-uri-template-http-client branch from7f2fe9b toc2a7b73CompareApril 19, 2024 07:14
@nicolas-grekas
Copy link
Member

Thank you@yann-eugone.

yann-eugone and asrorbekh reacted with heart emoji

@nicolas-grekasnicolas-grekas merged commit924e4d8 intosymfony:7.1Apr 19, 2024
@yann-eugone
Copy link
ContributorAuthor

Happy to help 🙂

@fabpot
Copy link
Member

Reverted in#54674

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@nicolas-grekasnicolas-grekasnicolas-grekas approved these changes

@derrabusderrabusderrabus approved these changes

Assignees

No one assigned

Projects

None yet

Milestone

7.1

Development

Successfully merging this pull request may close these issues.

5 participants

@yann-eugone@nicolas-grekas@fabpot@derrabus@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp