Skip to content

Commit fbb9a67

Browse files
committed
Merge branch '4.4' of github.com:symfony/symfony-docs into 4.4
* '4.4' of github.com:symfony/symfony-docs: [#14422] Minor change in sentence Adding information to the monolog autowire documentation that specifies that the channel must be defined
2 parents feef663 + 060773e commit fbb9a67

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

logging/channels_handlers.rst

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,8 +182,11 @@ How to Autowire Logger Channels
182182

183183
Starting from `MonologBundle`_ 3.5 you can autowire different Monolog channels
184184
by type-hinting your service arguments with the following syntax:
185-
``Psr\Log\LoggerInterface $<channel>Logger``. For example, to inject the service
186-
related to the ``app`` logger channel use this:
185+
``Psr\Log\LoggerInterface $<channel>Logger``. The ``<channel>`` must have been
186+
:ref:`predefined in your Monolog configuration <monolog-channels-config>`.
187+
188+
For example to inject the service related to the ``app`` logger channel,
189+
change your constructor like this:
187190

188191
.. code-block:: diff
189192

0 commit comments

Comments
 (0)