akka

event

package event

Content Hierarchy Learn more about scaladoc diagrams
Visibility
  1. Public
  2. All

Type Members

  1. trait ActorClassification extends AnyRef

    Maps ActorRefs to ActorRefs to form an EventBus where ActorRefs can listen to other ActorRefs

  2. trait ActorClassifier extends AnyRef

    Can be mixed into an EventBus to specify that the Classifier type is ActorRef

  3. trait ActorEventBus extends EventBus

    Represents an EventBus where the Subscriber type is ActorRef

  4. class BusLogging extends LoggingAdapter

    akka.event.LoggingAdapter that publishes akka.event.Logging.LogEvent to event stream.

  5. class DeadLetterListener extends Actor

  6. trait DiagnosticLoggingAdapter extends LoggingAdapter

    LoggingAdapter extension which adds MDC support.

    LoggingAdapter extension which adds MDC support. Only recommended to be used within Actors as it isn't thread safe.

  7. class DummyClassForStringSources extends AnyRef

    This is a “marker” class which is inserted as originator class into akka.event.Logging.LogEvent when the string representation was supplied directly.

  8. trait EventBus extends AnyRef

    Represents the base type for EventBuses Internally has an Event type, a Classifier type and a Subscriber type

    Represents the base type for EventBuses Internally has an Event type, a Classifier type and a Subscriber type

    For the Java API, see akka.event.japi.*

  9. class EventStream extends LoggingBus with SubchannelClassification

    An Akka EventStream is a pub-sub stream of events both system and user generated, where subscribers are ActorRefs and the channels are Classes and Events are any java.lang.Object.

    An Akka EventStream is a pub-sub stream of events both system and user generated, where subscribers are ActorRefs and the channels are Classes and Events are any java.lang.Object. EventStreams employ SubchannelClassification, which means that if you listen to a Class, you'll receive any message that is of that type or a subtype.

    The debug flag in the constructor toggles if operations on this EventStream should also be published as Debug-Events

  10. trait LogSource[-T] extends AnyRef

    This trait defines the interface to be provided by a “log source formatting rule” as used by akka.event.Logging’s apply/create method.

    This trait defines the interface to be provided by a “log source formatting rule” as used by akka.event.Logging’s apply/create method.

    See the companion object for default implementations.

    Example:

    trait MyType { // as an example
      def name: String
    }
    
    implicit val myLogSourceType: LogSource[MyType] = new LogSource[MyType] {
      def genString(a: MyType) = a.name
    }
    
    class MyClass extends MyType {
      val log = Logging(eventStream, this) // will use "hallo" as logSource
      def name = "hallo"
    }

    The second variant is used for including the actor system’s address:

    trait MyType { // as an example
      def name: String
    }
    
    implicit val myLogSourceType: LogSource[MyType] = new LogSource[MyType] {
      def genString(a: MyType) = a.name
      def genString(a: MyType, s: ActorSystem) = a.name + "," + s
    }
    
    class MyClass extends MyType {
      val sys = ActorSyste("sys")
      val log = Logging(sys, this) // will use "hallo,akka://sys" as logSource
      def name = "hallo"
    }

    The default implementation of the second variant will just call the first.

    Annotations
    @implicitNotFound( ... )
  11. trait LoggingAdapter extends AnyRef

    Logging wrapper to make nicer and optimize: provide template versions which evaluate .toString only if the log level is actually enabled.

    Logging wrapper to make nicer and optimize: provide template versions which evaluate .toString only if the log level is actually enabled. Typically used by obtaining an implementation from the Logging object:

    val log = Logging(<bus>, <source object>)
    ...
    log.info("hello world!")
    

    All log-level methods support simple interpolation templates with up to four arguments placed by using {} within the template (first string argument):

    log.error(exception, "Exception while processing {} in state {}", msg, state)
    

  12. trait LoggingBus extends ActorEventBus

    This trait brings log level handling to the EventStream: it reads the log levels for the initial logging (StandardOutLogger) and the loggers & level for after-init logging, possibly keeping the StandardOutLogger enabled if it is part of the configured loggers.

    This trait brings log level handling to the EventStream: it reads the log levels for the initial logging (StandardOutLogger) and the loggers & level for after-init logging, possibly keeping the StandardOutLogger enabled if it is part of the configured loggers. All configured loggers are treated as system services and managed by this trait, i.e. subscribed/unsubscribed in response to changes of LoggingBus.logLevel.

  13. class LoggingReceive extends Receive

    This decorator adds invocation logging to a Receive function.

  14. trait LookupClassification extends AnyRef

    Maps Subscribers to Classifiers using equality on Classifier to store a Set of Subscribers (hence the need for compareSubscribers) Maps Events to Classifiers through the classify-method (so it knows who to publish to)

    Maps Subscribers to Classifiers using equality on Classifier to store a Set of Subscribers (hence the need for compareSubscribers) Maps Events to Classifiers through the classify-method (so it knows who to publish to)

    The compareSubscribers need to provide a total ordering of the Subscribers

  15. trait PredicateClassifier extends AnyRef

    Can be mixed into an EventBus to specify that the Classifier type is a Function from Event to Boolean (predicate)

  16. trait ScanningClassification extends AnyRef

    Maps Classifiers to Subscribers and selects which Subscriber should receive which publication through scanning through all Subscribers through the matches(classifier, event) method

    Maps Classifiers to Subscribers and selects which Subscriber should receive which publication through scanning through all Subscribers through the matches(classifier, event) method

    Note: the compareClassifiers and compareSubscribers must together form an absolute ordering (think java.util.Comparator.compare)

  17. trait SubchannelClassification extends AnyRef

    Classification which respects relationships between channels: subscribing to one channel automatically and idempotently subscribes to all sub-channels.

Value Members

  1. object EventStream

  2. object LogSource

    This object holds predefined formatting rules for log sources.

    This object holds predefined formatting rules for log sources.

    In case an akka.actor.ActorSystem is provided, the following apply:

    • akka.actor.Actor and akka.actor.ActorRef will be represented by their absolute physical path
    • providing a String as source will append "(<system address>)" and use the result
    • providing a Class will extract its simple name, append "(<system address>)" and use the result
    • anything else gives compile error unless implicit akka.event.LogSource is in scope for it

    In case a akka.event.LoggingBus is provided, the following apply:

  3. object Logging

    Main entry point for Akka logging: log levels and message types (aka channels) defined for the main transport medium, the main event bus.

    Main entry point for Akka logging: log levels and message types (aka channels) defined for the main transport medium, the main event bus. The recommended use is to obtain an implementation of the Logging trait with suitable and efficient methods for generating log events:

    
    val log = Logging(<bus>, <source object>)
    ...
    log.info("hello world!")
    
    

    The source object is used in two fashions: its Class[_] will be part of all log events produced by this logger, plus a string representation is generated which may contain per-instance information, see apply or create below.

    Loggers are attached to the level-specific channels Error, Warning, Info and Debug as appropriate for the configured (or set) log level. If you want to implement your own, make sure to handle these four event types plus the InitializeLogger message which is sent before actually attaching it to the logging bus.

    Logging is configured by setting (some of) the following:

    
    akka {
      loggers = ["akka.slf4j.Slf4jLogger"] # for example
      loglevel = "INFO"        # used when normal logging ("loggers") has been started
      stdout-loglevel = "WARN" # used during application start-up until normal logging is available
    }
    
    

  4. object LoggingReceive

  5. object NoLogging extends LoggingAdapter

    NoLogging is a LoggingAdapter that does absolutely nothing – no logging at all.

  6. package japi

  7. package slf4j

Ungrouped