#2279 - making logging of RLCEs configurable

This commit is contained in:
Viktor Klang 2012-06-28 10:44:23 +02:00
parent 35056d765d
commit 54a9fc3035
4 changed files with 12 additions and 1 deletions

View file

@ -71,6 +71,9 @@ akka {
# If this is "on", Akka will log all outbound messages at DEBUG level, if off then they are not logged
log-sent-messages = off
# If this is "on", Akka will log all RemoteLifeCycleEvents at the level defined for each, if off then they are not logged
log-remote-lifecycle-events = off
# Each property is annotated with (I) or (O) or (I&O), where I stands for “inbound” and O for “outbound” connections.
# The NettyRemoteTransport always starts the server role to allow inbound connections, and it starts
# active client connections whenever sending to a destination which is not yet connected; if configured

View file

@ -14,4 +14,5 @@ class RemoteSettings(val config: Config, val systemName: String) {
val LogSend: Boolean = getBoolean("akka.remote.log-sent-messages")
val RemoteSystemDaemonAckTimeout: Duration = Duration(getMilliseconds("akka.remote.remote-daemon-ack-timeout"), MILLISECONDS)
val UntrustedMode: Boolean = getBoolean("akka.remote.untrusted-mode")
val LogRemoteLifeCycleEvents: Boolean = getBoolean("akka.remote.log-remote-lifecycle-events")
}

View file

@ -202,7 +202,7 @@ abstract class RemoteTransport(val system: ExtendedActorSystem, val provider: Re
*/
def notifyListeners(message: RemoteLifeCycleEvent): Unit = {
system.eventStream.publish(message)
system.log.log(message.logLevel, "{}", message)
if (logRemoteLifeCycleEvents) log.log(message.logLevel, "{}", message)
}
/**
@ -220,6 +220,11 @@ abstract class RemoteTransport(val system: ExtendedActorSystem, val provider: Re
*/
protected def useUntrustedMode: Boolean
/**
* When this method returns true, RemoteLifeCycleEvents will be logged as well as be put onto the eventStream.
*/
protected def logRemoteLifeCycleEvents: Boolean
/**
* Returns a newly created AkkaRemoteProtocol with the given message payload.
*/

View file

@ -128,6 +128,8 @@ private[akka] class NettyRemoteTransport(_system: ExtendedActorSystem, _provider
override protected def useUntrustedMode = remoteSettings.UntrustedMode
override protected def logRemoteLifeCycleEvents = remoteSettings.LogRemoteLifeCycleEvents
val server: NettyRemoteServer = try createServer() catch { case NonFatal(ex) shutdown(); throw ex }
/**