Skip to content

Commit

Permalink
[cookbook][logging] Adding index entries and minor tweaks for monolog…
Browse files Browse the repository at this point in the history
… emailing entry
  • Loading branch information
weaverryan committed Nov 26, 2011
1 parent c55d1a3 commit b7d6ff3
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 7 deletions.
4 changes: 3 additions & 1 deletion cookbook/index.rst
Expand Up @@ -70,11 +70,13 @@ Cookbook
templating/global_variables
templating/PHP

logging/monolog
logging/monolog_email

tools/autoloader
tools/finder
console
debugging
logging/monolog

event_dispatcher/class_extension
event_dispatcher/method_behavior
Expand Down
13 changes: 9 additions & 4 deletions cookbook/logging/monolog_email.rst
Expand Up @@ -11,6 +11,7 @@ it is broken down.

.. code-block:: yaml
# app/config/config.yml
monolog:
handlers:
mail:
Expand Down Expand Up @@ -60,10 +61,13 @@ it is broken down.
The ``mail`` handler is a ``fingerscrossed`` handler which means that
it is only triggered when the action level, in this case ``critical`` is reached.
It then logs everything including messages below the action level. The
``critical`` level is only triggered for 5xx HTTP code errors, if you only
set it to ``error`` then you will also receive emails for any 4xx code
errors as well. The ``handler`` setting means that the output is then passed
onto the ``buffered``handler.
``critical`` level is only triggered for 5xx HTTP code errors. The ``handler``
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``.

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
Expand All @@ -79,6 +83,7 @@ get logged on the server as well as the emails being sent:

.. code-block:: yaml
# app/config/config.yml
monolog:
handlers:
main:
Expand Down
8 changes: 6 additions & 2 deletions cookbook/map.rst.inc
Expand Up @@ -91,13 +91,17 @@
* :doc:`/cookbook/templating/global_variables`
* :doc:`/cookbook/templating/PHP`

* **Tools, Logging and Internals**
* **Logging**

* :doc:`/cookbook/logging/monolog`
* :doc:`/cookbook/logging/monolog_email`

* **Tools and Internals**

* :doc:`/cookbook/tools/autoloader`
* :doc:`/cookbook/tools/finder`
* :doc:`/cookbook/console`
* :doc:`/cookbook/debugging`
* :doc:`/cookbook/logging/monolog`

* **Web Services**

Expand Down

0 comments on commit b7d6ff3

Please sign in to comment.