Bug #104563
closedUse classname instead of ID for getLogger in LoggerAwarePass
100%
Description
Hello,
in my Services.yaml I have added following lines:
services: TYPO3\CMS\Core\Database\ConnectionPool: ~ db.connection.default: class: TYPO3\CMS\Core\Database\Connection factory: ['@TYPO3\CMS\Core\Database\ConnectionPool', 'getConnectionByName'] arguments: ['%default_connection_name%']
As class "Connection" includes the "LoggerAwareTrait", that class will be looped within the "LoggerAwarePass".
There you have following lines:
$channel = $id; if ($definition->getClass()) { $reflectionClass = $container->getReflectionClass($definition->getClass(), false); if ($reflectionClass) { $channel = $this->getClassChannelName($reflectionClass) ?? $channel; } }
Please remember that $id is "db.connection.default" here which is not helpful for Logger. I prefer using the classname out of Definition:
$channel = $id; if ($definition->getClass()) { $reflectionClass = $container->getReflectionClass($definition->getClass(), false); if ($reflectionClass) { $channel = $this->getClassChannelName($reflectionClass) ?? $definition->getClass(); } }
That way the logger was build up correctly again with a classname
Stefan
Updated by Gerrit Code Review 3 months ago
- Status changed from New to Under Review
Patch set 1 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/85561
Updated by Gerrit Code Review 3 months ago
Patch set 1 for branch 12.4 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/85466
Updated by Markus Klein 3 months ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset 103eb818e08d4c8c6fc4921281d6089154b16527.