From ba323dee2299e0c7051415f2ede77aedb3b07839 Mon Sep 17 00:00:00 2001 From: Ryan Weaver Date: Sat, 25 Oct 2014 12:26:18 -0400 Subject: [PATCH] Added a code example for emailing on 4xx and 5xx errors without 404's --- cookbook/logging/monolog_email.rst | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/cookbook/logging/monolog_email.rst b/cookbook/logging/monolog_email.rst index e51b3afea49..a609b4b5200 100644 --- a/cookbook/logging/monolog_email.rst +++ b/cookbook/logging/monolog_email.rst @@ -19,7 +19,12 @@ it is broken down. handlers: mail: type: fingers_crossed + # 500 errors are logged at the critical level action_level: critical + # to also log 400 level errors (but not 404's): + # action_level: error + # excluded_404: + # - ^/ handler: buffered buffered: type: buffer @@ -48,6 +53,12 @@ it is broken down. type="fingers_crossed" action-level="critical" handler="buffered" + /> array( 'type' => 'fingers_crossed', 'action_level' => 'critical', + // to also log 400 level errors (but not 404's): + // 'action_level' => 'error', + // 'excluded_404s' => array( + // '^/', + // ), 'handler' => 'buffered', ), 'buffered' => array( @@ -108,7 +124,8 @@ setting means that the output is then passed onto the ``buffered`` handler. .. tip:: If you want both 400 level and 500 level errors to trigger an email, - set the ``action_level`` to ``error`` instead of ``critical``. + set the ``action_level`` to ``error`` instead of ``critical``. See the + code above for an example. The ``buffered`` handler simply keeps all the messages for a request and then passes them onto the nested handler in one go. If you do not use this