Log actor failures in supervisor, see #2824

* To make it possible to override with application
  specific logging, or mute logging for certain failures
* Changed log level of Resume failures to WARNING, which
  caused all the changes to the tests
This commit is contained in:
Patrik Nordwall 2013-03-07 12:10:30 +01:00
parent 369811981e
commit f4d59383d7
17 changed files with 185 additions and 80 deletions

View file

@ -52,6 +52,13 @@ restarts per minute. ``-1`` and ``Duration.Inf()`` means that the respective lim
does not apply, leaving the possibility to specify an absolute upper limit on the
restarts or to make the restarts work infinitely.
.. note::
If the strategy is declared inside the supervising actor (as opposed to
a separate class) its decider has access to all internal state of
the actor in a thread-safe fashion, including obtaining a reference to the
currently failed child (available as the ``getSender`` of the failure message).
Default Supervisor Strategy
^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -78,6 +85,22 @@ loss of the child. This strategy is also provided pre-packaged as
:class:`StoppingSupervisorStrategy` configurator to be used when you want the
``"/user"`` guardian to apply it.
Logging of Actor Failures
^^^^^^^^^^^^^^^^^^^^^^^^^
By default the ``SupervisorStrategy`` logs failures unless they are escalated.
Escalated failures are supposed to be handled, and potentially logged, at a level
higher in the hierarchy.
You can mute the default logging of a ``SupervisorStrategy`` by setting
``loggingEnabled`` to ``false`` when instantiating it. Customized logging
can be done inside the ``Decider``. Note that the reference to the currently
failed child is available as the ``getSender`` when the ``SupervisorStrategy`` is
declared inside the supervising actor.
You may also customize the logging in your own ``SupervisorStrategy`` implementation
by overriding the ``logFailure`` method.
Supervision of Top-Level Actors
-------------------------------

View file

@ -739,7 +739,7 @@ Please note, that the child actors are *still restarted*, but no new ``ActorRef`
the same principles for the children, ensuring that their ``preStart()`` method is called only at the creation of their
refs.
For more information see :ref:`what-restarting-means-scala`.
For more information see :ref:`supervision-restart`.
Initialization via message passing
----------------------------------