8000 [#1654] Tweaking comments in channel handlers doc to point to reference · smoya/symfony-docs@7cc08f4 · GitHub
[go: up one dir, main page]

Skip to content
< 8000 header class="HeaderMktg header-logged-out js-details-container js-header Details f4 py-3" role="banner" data-is-top="true" data-color-mode=light data-light-theme=light data-dark-theme=dark>

Navigation Menu

Sign in
Appearance settings

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

Provide feedback

8000

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

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 7cc08f4

Browse files
committed
[symfony#1654] Tweaking comments in channel handlers doc to point to reference
1 parent 4dc6a36 commit 7cc08f4

File tree

1 file changed

+7
-15
lines changed

1 file changed

+7
-15
lines changed

cookbook/logging/channels_handlers.rst

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -81,24 +81,16 @@ You can specify the configuration by many forms:
8181
type: exclusive # Include all, except those listed below
8282
elements: [ foo, bar ]
8383
84-
Creating your own channel
84+
Creating your own Channel
8585
-------------------------
8686

87-
You can change the channel monolog logs to one service at a time. This is done with the dependency injection tag ``monolog.logger``.
87+
You can change the channel monolog logs to one service at a time. This is done
88+
by tagging your service with ``monolog.logger`` and specifying which channel
89+
the service should log to. By doing this, the logger that is injected into
90+
that service is preconfigured to use the channel you've specified.
8891

89-
For example the Doctrine channel mentioned above is configured this way:
90-
91-
.. code-block:: xml
92-
93-
<service id="doctrine.dbal.logger" class="%doctrine.dbal.logger.class%" public="false">
94-
<tag name="monolog.logger" channel="doctrine" />
95-
<argument type="service" id="logger" on-invalid="null" />
96-
<argument type="service" id="debug.stopwatch" on-invalid="null" />
97-
</service>
98-
99-
The ``logger`` service passed to ``doctrine.dbal.logger`` now logs to the ``doctrine`` channel.
100-
101-
To change the channel of the logger instance inside a particular service, just use the ``monolog.logger`` tag and specify the ``channel`` attribute.
92+
For more information - including a full example - read ":ref:`dic_tags-monolog`"
93+
in the Dependency Injection Tags reference section.
10294

10395
Learn more from the Cookbook
10496
----------------------------

0 commit comments

Comments
 (0)
0