File tree Expand file tree Collapse file tree 1 file changed +7
-15
lines changed
Filter options
Expand file tree Collapse file tree 1 file changed +7
-15
lines changed
Original file line number Diff line number Diff line change @@ -81,24 +81,16 @@ You can specify the configuration by many forms:
81
81
type : exclusive # Include all, except those listed below
82
82
elements : [ foo, bar ]
83
83
84
- Creating your own channel
84
+ Creating your own Channel
85
85
-------------------------
86
86
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.
88
91
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.
102
94
103
95
Learn more from the Cookbook
104
96
----------------------------
You can’t perform that action at this time.
0 commit comments