diff --git a/akka-actor-tests/src/test/scala/akka/config/DeprecatedEventHandlerSpec.scala b/akka-actor-tests/src/test/scala/akka/config/DeprecatedEventHandlerSpec.scala deleted file mode 100644 index 09d03c36a6..0000000000 --- a/akka-actor-tests/src/test/scala/akka/config/DeprecatedEventHandlerSpec.scala +++ /dev/null @@ -1,53 +0,0 @@ -/** - * Copyright (C) 2009-2013 Typesafe Inc. - */ - -package akka.config - -import scala.concurrent.duration._ -import akka.testkit.AkkaSpec -import akka.actor.Actor -import akka.event.Logging.InitializeLogger -import akka.event.Logging.LogEvent -import akka.event.Logging.LoggerInitialized -import akka.event.Logging.Error -import akka.util.Timeout - -object DeprecatedEventHandlerSpec { - - case class WrappedLogEvent(event: Any) - - class TestEventHandler extends Actor { - def receive = { - case init: InitializeLogger ⇒ - sender ! LoggerInitialized - case err: Error ⇒ - context.system.eventStream.publish(WrappedLogEvent(err)) - case event: LogEvent ⇒ - } - } -} - -@org.junit.runner.RunWith(classOf[org.scalatest.junit.JUnitRunner]) -class DeprecatedEventHandlerSpec extends AkkaSpec(""" - akka.event-handlers = ["akka.config.DeprecatedEventHandlerSpec$TestEventHandler"] - akka.event-handler-startup-timeout = 17s - """) { - - import DeprecatedEventHandlerSpec._ - - "Akka 2.2" must { - "use deprected event-handler properties" in { - system.settings.EventHandlers must be(List(classOf[TestEventHandler].getName)) - system.settings.EventHandlerStartTimeout must be(Timeout(17.seconds)) - - system.eventStream.subscribe(testActor, classOf[WrappedLogEvent]) - - system.log.error("test error") - expectMsgPF(remaining) { - case WrappedLogEvent(Error(_, _, _, "test error")) ⇒ - } - - } - } -} diff --git a/akka-actor/src/main/resources/reference.conf b/akka-actor/src/main/resources/reference.conf index b0a7781f8b..5139ee2776 100644 --- a/akka-actor/src/main/resources/reference.conf +++ b/akka-actor/src/main/resources/reference.conf @@ -16,17 +16,11 @@ akka { # to STDOUT) loggers = ["akka.event.Logging$DefaultLogger"] - # Deprecated, use akka.loggers. - event-handlers = [] - # Loggers are created and registered synchronously during ActorSystem # start-up, and since they are actors, this timeout is used to bound the # waiting time logger-startup-timeout = 5s - # Deprecated, use akka.logger-startup-timeout - event-handler-startup-timeout = -1s - # Log level used by the configured loggers (see "loggers") as soon # as they have been started; before that, see "stdout-loglevel" # Options: OFF, ERROR, WARNING, INFO, DEBUG diff --git a/akka-actor/src/main/scala/akka/actor/ActorSystem.scala b/akka-actor/src/main/scala/akka/actor/ActorSystem.scala index 92afd9f7f7..7c3279afaf 100644 --- a/akka-actor/src/main/scala/akka/actor/ActorSystem.scala +++ b/akka-actor/src/main/scala/akka/actor/ActorSystem.scala @@ -146,10 +146,6 @@ object ActorSystem { final val StdoutLogLevel: String = getString("akka.stdout-loglevel") final val Loggers: immutable.Seq[String] = immutableSeq(getStringList("akka.loggers")) final val LoggerStartTimeout: Timeout = Timeout(Duration(getMilliseconds("akka.logger-startup-timeout"), MILLISECONDS)) - @deprecated("use Loggers)", "2.2") - final val EventHandlers: immutable.Seq[String] = immutableSeq(getStringList("akka.event-handlers")) - @deprecated("use LoggerStartTimeout)", "2.2") - final val EventHandlerStartTimeout: Timeout = Timeout(Duration(getMilliseconds("akka.event-handler-startup-timeout"), MILLISECONDS)) final val LogConfigOnStart: Boolean = config.getBoolean("akka.log-config-on-start") final val LogDeadLetters: Int = config.getString("akka.log-dead-letters").toLowerCase match { case "off" | "false" ⇒ 0 diff --git a/akka-actor/src/main/scala/akka/event/Logging.scala b/akka-actor/src/main/scala/akka/event/Logging.scala index eef6d5288a..d2af82bbea 100644 --- a/akka-actor/src/main/scala/akka/event/Logging.scala +++ b/akka-actor/src/main/scala/akka/event/Logging.scala @@ -99,14 +99,9 @@ trait LoggingBus extends ActorEventBus { ErrorLevel } try { - val defaultLoggers = system.settings.EventHandlers match { - case Nil ⇒ system.settings.Loggers match { - case Nil ⇒ classOf[DefaultLogger].getName :: Nil - case loggers ⇒ loggers - } - case loggers ⇒ - publish(Warning(logName, this.getClass, "[akka.event-handlers] config is deprecated, use [akka.loggers]")) - loggers + val defaultLoggers = system.settings.Loggers match { + case Nil ⇒ classOf[DefaultLogger].getName :: Nil + case loggers ⇒ loggers } val myloggers = for { @@ -142,9 +137,9 @@ trait LoggingBus extends ActorEventBus { } } catch { case e: Exception ⇒ - System.err.println("error while starting up EventHandler") + System.err.println("error while starting up loggers") e.printStackTrace() - throw new ConfigurationException("Could not start Event Handler due to [" + e.toString + "]") + throw new ConfigurationException("Could not start logger due to [" + e.toString + "]") } } @@ -177,13 +172,7 @@ trait LoggingBus extends ActorEventBus { private def addLogger(system: ActorSystemImpl, clazz: Class[_ <: Actor], level: LogLevel, logName: String): ActorRef = { val name = "log" + Extension(system).id() + "-" + simpleName(clazz) val actor = system.systemActorOf(Props(clazz), name) - implicit def timeout = - if (system.settings.EventHandlerStartTimeout.duration >= Duration.Zero) { - publish(Warning(logName, this.getClass, - "[akka.event-handler-startup-timeout] config is deprecated, use [akka.logger-startup-timeout]")) - system.settings.EventHandlerStartTimeout - } else system.settings.LoggerStartTimeout - + implicit def timeout = system.settings.LoggerStartTimeout import akka.pattern.ask val response = try Await.result(actor ? InitializeLogger(this), timeout.duration) catch { case _: TimeoutException ⇒ diff --git a/akka-docs/rst/project/migration-guide-2.1.x-2.2.x.rst b/akka-docs/rst/project/migration-guide-2.1.x-2.2.x.rst index d94d29764a..4618faded7 100644 --- a/akka-docs/rst/project/migration-guide-2.1.x-2.2.x.rst +++ b/akka-docs/rst/project/migration-guide-2.1.x-2.2.x.rst @@ -5,4 +5,4 @@ ################################ Migration from 2.1.x to 2.2.x is described in the -`documentation of 2.2 `_. \ No newline at end of file +`documentation of 2.2 `_. \ No newline at end of file diff --git a/akka-docs/rst/project/migration-guide-2.2.x-2.3.x.rst b/akka-docs/rst/project/migration-guide-2.2.x-2.3.x.rst index 8d2e54b26b..4f9a96fc42 100644 --- a/akka-docs/rst/project/migration-guide-2.2.x-2.3.x.rst +++ b/akka-docs/rst/project/migration-guide-2.2.x-2.3.x.rst @@ -98,4 +98,11 @@ Changed cluster expected-response-after configuration Configuration property ``akka.cluster.failure-detector.heartbeat-request.expected-response-after`` has been renamed to ``akka.cluster.failure-detector.expected-response-after``. - \ No newline at end of file + +Removed Deprecated Features +=========================== + +The following, previously deprecated features have been removed: + + * `event-handlers renamed to loggers `_ + diff --git a/akka-slf4j/src/main/scala/akka/event/slf4j/Slf4jEventHandler.scala b/akka-slf4j/src/main/scala/akka/event/slf4j/Slf4jEventHandler.scala deleted file mode 100644 index 1e5b99961c..0000000000 --- a/akka-slf4j/src/main/scala/akka/event/slf4j/Slf4jEventHandler.scala +++ /dev/null @@ -1,14 +0,0 @@ -/** - * Copyright (C) 2009-2013 Typesafe Inc. - */ -package akka.event.slf4j - -import akka.event.Logging.Warning - -@deprecated("use akka.event.slf4j.Slf4jLogger)", "2.2") -class Slf4jEventHandler extends Slf4jLogger { - - self ! Warning(getClass.getName, getClass, - s"[${getClass.getName}] is deprecated, use [${classOf[Slf4jLogger].getName}] instead") - -} \ No newline at end of file