Rename event-handlers to loggers, see #2979

* Rename config akka.event-handlers to akka.loggers
* Rename config akka.event-handler-startup-timeout to
  akka.logger-startup-timeout
* Rename JulEventHandler to JavaLogger
* Rename Slf4jEventHandler to Slf4jLogger
* Change all places in tests and docs
* Deprecation, old still works, but with warnings
* Migration guide
* Test for the deprecated event-handler config
This commit is contained in:
Patrik Nordwall 2013-02-01 08:02:53 +01:00
parent c6f08fb935
commit 2476831705
37 changed files with 347 additions and 216 deletions

View file

@ -50,7 +50,7 @@ public class TestKitDocTest {
@BeforeClass
public static void setup() {
final Config config = ConfigFactory.parseString(
"akka.event-handlers = [akka.testkit.TestEventListener]");
"akka.loggers = [akka.testkit.TestEventListener]");
system = ActorSystem.create("demoSystem", config);
}

View file

@ -175,7 +175,7 @@ stream for logging: these are the handlers which are configured for example in
.. code-block:: text
akka {
event-handlers = ["akka.event.Logging$DefaultLogger"]
loggers = ["akka.event.Logging$DefaultLogger"]
}
The handlers listed here by fully-qualified class name will be subscribed to

View file

@ -154,24 +154,25 @@ If you want to see all messages that are received through remoting at DEBUG log
Also see the logging options for TestKit: :ref:`actor.logging-java`.
Event Handler
=============
Loggers
=======
Logging is performed asynchronously through an event bus. You can configure which event handlers that should
subscribe to the logging events. That is done using the 'event-handlers' element in the :ref:`configuration`.
Logging is performed asynchronously through an event bus. You can configure which loggers that should
subscribe to the logging events. That is done using the 'loggers' element in the :ref:`configuration`.
Here you can also define the log level.
.. code-block:: ruby
akka {
# Event handlers to register at boot time (Logging$DefaultLogger logs to STDOUT)
event-handlers = ["akka.event.Logging$DefaultLogger"]
# Loggers to register at boot time (akka.event.Logging$DefaultLogger logs
# to STDOUT)
loggers = ["akka.event.Logging$DefaultLogger"]
# Options: ERROR, WARNING, INFO, DEBUG
loglevel = "DEBUG"
}
The default one logs to STDOUT and is registered by default. It is not intended to be used for production. There is also an :ref:`slf4j-java`
event handler available in the 'akka-slf4j' module.
logger available in the 'akka-slf4j' module.
Example of creating a listener:
@ -186,7 +187,7 @@ Example of creating a listener:
SLF4J
=====
Akka provides an event handler for `SL4FJ <http://www.slf4j.org/>`_. This module is available in the 'akka-slf4j.jar'.
Akka provides a logger for `SL4FJ <http://www.slf4j.org/>`_. This module is available in the 'akka-slf4j.jar'.
It has one single dependency; the slf4j-api jar. In runtime you also need a SLF4J backend, we recommend `Logback <http://logback.qos.ch/>`_:
.. code-block:: xml
@ -197,7 +198,7 @@ It has one single dependency; the slf4j-api jar. In runtime you also need a SLF4
<version>1.0.7</version>
</dependency>
You need to enable the Slf4jEventHandler in the 'event-handlers' element in
You need to enable the Slf4jLogger in the 'loggers' element in
the :ref:`configuration`. Here you can also define the log level of the event bus.
More fine grained log levels can be defined in the configuration of the SLF4J backend
(e.g. logback.xml).
@ -205,7 +206,7 @@ More fine grained log levels can be defined in the configuration of the SLF4J ba
.. code-block:: ruby
akka {
event-handlers = ["akka.event.slf4j.Slf4jEventHandler"]
loggers = ["akka.event.slf4j.Slf4jLogger"]
loglevel = "DEBUG"
}

View file

@ -305,11 +305,11 @@ fails.
.. note::
Be sure to exchange the default event handler with the
Be sure to exchange the default logger with the
:class:`TestEventListener` in your ``application.conf`` to enable this
function::
akka.event-handlers = [akka.testkit.TestEventListener]
akka.loggers = [akka.testkit.TestEventListener]
.. _JavaTestKit.within: