diff --git a/cookbook/logging/monolog_email.rst b/cookbook/logging/monolog_email.rst index f23f0510cc6..bdb71adae77 100644 --- a/cookbook/logging/monolog_email.rst +++ b/cookbook/logging/monolog_email.rst @@ -25,9 +25,9 @@ it is broken down. # action_level: error # excluded_404s: # - ^/ - handler: buffered - buffered: - type: buffer + handler: deduplicated + deduplicated: + type: deduplication handler: swift swift: type: swift_mailer @@ -35,8 +35,10 @@ it is broken down. to_email: 'error@example.com' # or list of recipients # to_email: ['dev1@example.com', 'dev2@example.com', ...] - subject: An Error Occurred! + subject: 'An Error Occurred! %%message%%' level: debug + formatter: monolog.formatter.html + content_type: text/html .. code-block:: xml @@ -49,8 +51,9 @@ it is broken down. http://symfony.com/schema/dic/monolog http://symfony.com/schema/dic/monolog/monolog-1.0.xsd"> - + + + @@ -230,29 +255,33 @@ get logged on the server as well as the emails being sent: ), 'grouped' => array( 'type' => 'group', - 'members' => array('streamed', 'buffered'), + 'members' => array('streamed', 'deduplicated'), ), 'streamed' => array( 'type' => 'stream', 'path' => '%kernel.logs_dir%/%kernel.environment%.log', 'level' => 'debug', ), - 'buffered' => array( - 'type' => 'buffer', - 'handler' => 'swift', + 'deduplicated' => array( + 'type' => 'deduplication', + 'handler' => 'swift', ), 'swift' => array( - 'type' => 'swift_mailer', - 'from_email' => 'error@example.com', - 'to_email' => 'error@example.com', - 'subject' => 'An Error Occurred!', - 'level' => 'debug', + 'type' => 'swift_mailer', + 'from_email' => 'error@example.com', + 'to_email' => 'error@example.com', + // or a list of recipients + // 'to_email' => array('dev1@example.com', 'dev2@example.com', ...), + 'subject' => 'An Error Occurred! %%message%%', + 'level' => 'debug', + 'formatter' => 'monolog.formatter.html', + 'content_type' => 'text/html', ), ), )); This uses the ``group`` handler to send the messages to the two -group members, the ``buffered`` and the ``stream`` handlers. The messages will +group members, the ``deduplicated`` and the ``stream`` handlers. The messages will now be both written to the log file and emailed. .. _Monolog: https://github.com/Seldaek/monolog