Skip to content

Commit 9098d5d

Browse files
committed
Merge branch '5.2' into 5.3
* 5.2: Specified camelCase format limitation for logger channel autowiring
2 parents 08e0eed + c3218ac commit 9098d5d

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

logging/channels_handlers.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -177,18 +177,18 @@ How to Autowire Logger Channels
177177

178178
Starting from `MonologBundle`_ 3.5 you can autowire different Monolog channels
179179
by type-hinting your service arguments with the following syntax:
180-
``Psr\Log\LoggerInterface $<channel>Logger``. The ``<channel>`` must have been
181-
:ref:`predefined in your Monolog configuration <monolog-channels-config>`.
180+
``Psr\Log\LoggerInterface $<camelCased channel name> + Logger``. The ``<channel>``
181+
must have been :ref:`predefined in your Monolog configuration <monolog-channels-config>`.
182182

183-
For example to inject the service related to the ``app`` logger channel,
183+
For example to inject the service related to the ``foo_bar`` logger channel,
184184
change your constructor like this:
185185

186186
.. code-block:: diff
187187
188188
- public function __construct(LoggerInterface $logger)
189-
+ public function __construct(LoggerInterface $appLogger)
189+
+ public function __construct(LoggerInterface $fooBarLogger)
190190
{
191-
$this->logger = $appLogger;
191+
$this->logger = $fooBarLogger;
192192
}
193193
194194
.. _`MonologBundle`: https://github.com/symfony/monolog-bundle

0 commit comments

Comments
 (0)