Skip to content

Navigation Menu

Sign in
Appearance settings

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

Provide feedback

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 filesBrowse files
committed
[symfony#1654] Tweaking comments in channel handlers doc to point to reference
1 parent 4dc6a36 commit 7cc08f4
Copy full SHA for 7cc08f4

File tree

Expand file treeCollapse file tree

1 file changed

+7
-15
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+7
-15
lines changed

‎cookbook/logging/channels_handlers.rst

Copy file name to clipboardExpand all lines: cookbook/logging/channels_handlers.rst
+7-15Lines 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)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.