@@ -23,15 +23,15 @@ the channel).
23
23
Switching a Channel to a different Handler
24
24
------------------------------------------
25
25
26
- Now, suppose you want to log the ``security `` channel to a different file
27
- in the `` prod `` environment. To do this, just create a new handler and configure
28
- it to log only messages from the ``security `` channel:
26
+ Now, suppose you want to log the ``security `` channel to a different file.
27
+ To do this, just create a new handler and configure it to log only messages
28
+ from the ``security `` channel:
29
29
30
30
.. configuration-block ::
31
31
32
32
.. code-block :: yaml
33
33
34
- # app/config/config_prod .yml
34
+ # app/config/config .yml
35
35
monolog :
36
36
handlers :
37
37
security :
@@ -41,7 +41,7 @@ it to log only messages from the ``security`` channel:
41
41
path : " %kernel.logs_dir%/security.log"
42
42
channels : [security]
43
43
44
- # an example of *not* logging security channel messages
44
+ # an example of *not* logging security channel messages for this handler
45
45
main :
46
46
# ...
47
47
# channels: ["!security"]
@@ -64,12 +64,11 @@ it to log only messages from the ``security`` channel:
64
64
</monolog : channels >
65
65
</monolog : handler >
66
66
67
- <monolog : handler name =" main" type =" stream" path =" %kernel.logs_dir%/security .log" >
68
- <!--
67
+ <monolog : handler name =" main" type =" stream" path =" %kernel.logs_dir%/main .log" >
68
+ <!-- ... -->
69
69
<monolog : channels >
70
70
<monolog : channel >!security</monolog : channel >
71
71
</monolog : channels >
72
- -->
73
72
</monolog : handler >
74
73
</monolog : config >
75
74
</container >
@@ -87,13 +86,10 @@ it to log only messages from the ``security`` channel:
87
86
),
88
87
),
89
88
'main' => array(
90
- 'type' => 'stream',
91
- 'path' => '%kernel.logs_dir%/security.log',
92
- /*
89
+ // ...
93
90
'channels' => array(
94
91
'!security',
95
92
),
96
- */
97
93
),
98
94
),
99
95
));
0 commit comments