Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[Cache] No logs with TagAwareAdapter #40108

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
fancyweb opened this issue Feb 5, 2021 · 3 comments
Closed

[Cache] No logs with TagAwareAdapter #40108

fancyweb opened this issue Feb 5, 2021 · 3 comments

Comments

@fancyweb
Copy link
Contributor

fancyweb commented Feb 5, 2021

Symfony version(s) affected: all

Contrary to other adapters, TagAwareAdapter does not have a $logger property so it produces no logs. It's especially visible if you have an existing pool: adding tags: true makes the logs disappear. Implementing LoggerAwareInterface and using LoggerAwareTrait + tweaking some DI definitions resolve it. Can we consider this a bug fix, or is that a feature?

@nicolas-grekas
Copy link
Member

But a TagAwareAdapter takes another pool as argument. It's expected that this decorated pool logs. Maybe that's a wiring issue then?

@fancyweb
Copy link
Contributor Author

fancyweb commented Feb 5, 2021

The decorated pool does not log.
https://github.com/symfony/symfony/blob/4.4/src/Symfony/Component/Cache/Traits/ContractsTrait.php#L88 $this->logger here does not exist.

@nicolas-grekas
Copy link
Member

nicolas-grekas commented Feb 5, 2021

That's why then. PR welcome :)

nicolas-grekas added a commit that referenced this issue Apr 11, 2021
…fancyweb)

This PR was merged into the 4.4 branch.

Discussion
----------

[Cache][FrameworkBundle] Fix logging for TagAwareAdapter

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | #40108
| License       | MIT
| Doc PR        | -

Commits
-------

6b0beca [Cache] [FrameworkBundle] Fix logging for TagAwareAdapter
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants