Skip to content

Commit 78323d8

Browse files
committed
Changing back to config.yml and fixing some code block mistakes thanks to Wouter
1 parent f9f3c3f commit 78323d8

File tree

1 file changed

+8
-12
lines changed

1 file changed

+8
-12
lines changed

cookbook/logging/channels_handlers.rst

+8-12
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,15 @@ the channel).
2323
Switching a Channel to a different Handler
2424
------------------------------------------
2525

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:
2929

3030
.. configuration-block::
3131

3232
.. code-block:: yaml
3333
34-
# app/config/config_prod.yml
34+
# app/config/config.yml
3535
monolog:
3636
handlers:
3737
security:
@@ -41,7 +41,7 @@ it to log only messages from the ``security`` channel:
4141
path: "%kernel.logs_dir%/security.log"
4242
channels: [security]
4343
44-
# an example of *not* logging security channel messages
44+
# an example of *not* logging security channel messages for this handler
4545
main:
4646
# ...
4747
# channels: ["!security"]
@@ -64,12 +64,11 @@ it to log only messages from the ``security`` channel:
6464
</monolog:channels>
6565
</monolog:handler>
6666
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+
<!-- ... -->
6969
<monolog:channels>
7070
<monolog:channel>!security</monolog:channel>
7171
</monolog:channels>
72-
-->
7372
</monolog:handler>
7473
</monolog:config>
7574
</container>
@@ -87,13 +86,10 @@ it to log only messages from the ``security`` channel:
8786
),
8887
),
8988
'main' => array(
90-
'type' => 'stream',
91-
'path' => '%kernel.logs_dir%/security.log',
92-
/*
89+
// ...
9390
'channels' => array(
9491
'!security',
9592
),
96-
*/
9793
),
9894
),
9995
));

0 commit comments

Comments
 (0)