Skip to content

Commit

Permalink
Added using the group handler to Monlolg example
Browse files Browse the repository at this point in the history
  • Loading branch information
richardmiller-zz authored and weaverryan committed Nov 26, 2011
1 parent 3f2cce0 commit 6f92162
Showing 1 changed file with 26 additions and 22 deletions.
48 changes: 26 additions & 22 deletions cookbook/logging/monolog_email.rst
Expand Up @@ -82,20 +82,19 @@ get logged on the server as well as the emails being sent:
monolog:
handlers:
main:
type: fingers_crossed
action_level: error
handler: nested
nested:
type: stream
path: %kernel.logs_dir%/%kernel.environment%.log
level: debug
mail:
type: fingers_crossed
action_level: critical
handler: buffered
buffered:
type: buffer
handler: swift
handler: grouped
grouped:
type: group
members: [streamed, swift]
streamed:
type: stream
path: %kernel.logs_dir%/%kernel.environment%.log
level: debug
swift:
type: swift_mailer
from_email: error@example.com
Expand All @@ -115,23 +114,24 @@ get logged on the server as well as the emails being sent:
<monolog:handler
name="main"
type="fingers_crossed"
action_level="error"
handler="nested"
<monolog:handler
name="nested"
type="stream"
path="%kernel.logs_dir%/%kernel.environment%.log"
level="debug"
<monolog:handler
name="mail"
type="fingerscrossed"
action-level="critical"
action_level="critical"
handler="buffered"
/>
<monolog:handler
name="buffered"
type="buffer"
handler="swift"
handler="grouped"
/>
<monolog:handler
name="grouped"
type="group"
<member type="stream"/>
<member type="swift"/>
/>
<monolog:handler
name="stream"
path="%kernel.logs_dir%/%kernel.environment%.log"
level="debug"
/>
<monolog:handler
name="swift"
Expand All @@ -143,4 +143,8 @@ get logged on the server as well as the emails being sent:
</monolog:config>
</container>
.. _Monolog: https://github.com/Seldaek/monolog
This uses the ```group`` handler to send the buffered messages to the two
group members, the ``swift`` and the ``stream`` handlers. The messages will
now be both written to the log file and emailed.

.. _Monolog: https://github.com/Seldaek/monolog

0 comments on commit 6f92162

Please sign in to comment.