akka.event

Logging

object Logging extends AnyRef

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 in akka.conf by setting (some of) the following:


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

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Hide All
  2. Show all
  1. Logging
  2. AnyRef
  3. Any
Visibility
  1. Public
  2. All

Type Members

  1. case class Debug (logSource: String, logClass: Class[_], message: Any) extends LogEvent with Product with Serializable

    For DEBUG Logging

  2. class DefaultLogger extends Actor with StdOutLogger

    Actor wrapper around the standard output logger.

  3. case class Error (cause: Throwable, logSource: String, logClass: Class[_], message: Any) extends LogEvent with Product with Serializable

    For ERROR Logging

  4. class EventHandlerException extends AkkaException

    Artificial exception injected into Error events if no Throwable is supplied; used for getting a stack dump of error locations.

  5. case class Info (logSource: String, logClass: Class[_], message: Any) extends LogEvent with Product with Serializable

    For INFO Logging

  6. case class InitializeLogger (bus: LoggingBus) extends NoSerializationVerificationNeeded with Product with Serializable

    Message which is sent to each default logger (i.

  7. trait LogEvent extends AnyRef

    Base type of LogEvents

  8. class LogEventException extends Throwable with NoStackTrace

    Exception that wraps a LogEvent.

  9. class LogExt extends Extension

  10. type LogLevel = Int with LogLevelType

    Log level in numeric form, used when deciding whether a certain log statement should generate a log event.

    Log level in numeric form, used when deciding whether a certain log statement should generate a log event. Predefined levels are ErrorLevel (1) to DebugLevel (4). In case you want to add more levels, loggers need to be subscribed to their event bus channels manually.

  11. trait LogLevelType extends AnyRef

    Marker trait for annotating LogLevel, which must be Int after erasure.

  12. class LoggerInitializationException extends AkkaException

  13. class StandardOutLogger extends InternalActorRef with MinimalActorRef with StdOutLogger

    Actor-less logging implementation for synchronous logging to standard output.

  14. trait StdOutLogger extends AnyRef

  15. case class Warning (logSource: String, logClass: Class[_], message: Any) extends LogEvent with Product with Serializable

    For WARNING Logging

Value Members

  1. def != (arg0: AnyRef): Boolean

    Attributes
    final
    Definition Classes
    AnyRef
  2. def != (arg0: Any): Boolean

    Attributes
    final
    Definition Classes
    Any
  3. def ## (): Int

    Attributes
    final
    Definition Classes
    AnyRef → Any
  4. def == (arg0: AnyRef): Boolean

    Attributes
    final
    Definition Classes
    AnyRef
  5. def == (arg0: Any): Boolean

    Attributes
    final
    Definition Classes
    Any
  6. val AllLogLevels : Seq[LogLevel]

  7. val DebugLevel : Int with LogLevelType

    Attributes
    final
  8. object Error extends Serializable

  9. val ErrorLevel : Int with LogLevelType

    Attributes
    final
  10. object Extension extends ExtensionKey[LogExt]

  11. val InfoLevel : Int with LogLevelType

    Attributes
    final
  12. object LoggerInitialized extends Product with Serializable

    Response message each logger must send within 1 second after receiving the InitializeLogger request.

  13. val StandardOutLogger : StandardOutLogger

  14. val StandardOutLoggerName : String

  15. val WarningLevel : Int with LogLevelType

    Attributes
    final
  16. def apply [T] (bus: LoggingBus, logSource: T)(implicit arg0: LogSource[T]): LoggingAdapter

    Obtain LoggingAdapter for the given logging bus and source object.

    Obtain LoggingAdapter for the given logging bus and source object.

    The source is used to identify the source of this logging channel and must have a corresponding implicit LogSource[T] instance in scope; by default these are provided for Class[_], Actor, ActorRef and String types. See the companion object of LogSource for details.

    You can add your own rules quite easily, see LogSource.

  17. def apply [T] (system: ActorSystem, logSource: T)(implicit arg0: LogSource[T]): LoggingAdapter

    Obtain LoggingAdapter for the given actor system and source object.

    Obtain LoggingAdapter for the given actor system and source object. This will use the system’s event stream and include the system’s address in the log source string.

    Do not use this if you want to supply a log category string (like “com.example.app.whatever”) unaltered, supply system.eventStream in this case or use

    Logging(system, this.getClass)
    

    The source is used to identify the source of this logging channel and must have a corresponding implicit LogSource[T] instance in scope; by default these are provided for Class[_], Actor, ActorRef and String types. See the companion object of LogSource for details.

    You can add your own rules quite easily, see LogSource.

  18. def asInstanceOf [T0] : T0

    Attributes
    final
    Definition Classes
    Any
  19. def classFor (level: LogLevel): Class[_ <: akka.event.Logging.LogEvent]

    Returns the event class associated with the given LogLevel

  20. def clone (): AnyRef

    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  21. val debugFormat : String

  22. def eq (arg0: AnyRef): Boolean

    Attributes
    final
    Definition Classes
    AnyRef
  23. def equals (arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  24. val errorFormat : String

  25. val errorFormatWithoutCause : String

  26. def finalize (): Unit

    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  27. def getClass (): java.lang.Class[_]

    Attributes
    final
    Definition Classes
    AnyRef → Any
  28. def getLogger (bus: LoggingBus, logSource: AnyRef): LoggingAdapter

    Obtain LoggingAdapter for the given logging bus and source object.

    Obtain LoggingAdapter for the given logging bus and source object.

    The source is used to identify the source of this logging channel and must have a corresponding implicit LogSource[T] instance in scope; by default these are provided for Class[_], Actor, ActorRef and String types. See the companion object of LogSource for details.

  29. def getLogger (system: ActorSystem, logSource: AnyRef): LoggingAdapter

    Obtain LoggingAdapter for the given actor system and source object.

    Obtain LoggingAdapter for the given actor system and source object. This will use the system’s event stream and include the system’s address in the log source string.

    Do not use this if you want to supply a log category string (like “com.example.app.whatever”) unaltered, supply system.eventStream in this case or use

    Logging.getLogger(system, this.getClass());
    

    The source is used to identify the source of this logging channel and must have a corresponding implicit LogSource[T] instance in scope; by default these are provided for Class[_], Actor, ActorRef and String types. See the companion object of LogSource for details.

  30. def hashCode (): Int

    Definition Classes
    AnyRef → Any
  31. val infoFormat : String

  32. def isInstanceOf [T0] : Boolean

    Attributes
    final
    Definition Classes
    Any
  33. def levelFor (eventClass: Class[_ <: akka.event.Logging.LogEvent]): LogLevel

    Returns the LogLevel associated with the given event class.

    Returns the LogLevel associated with the given event class. Defaults to DebugLevel.

  34. def levelFor (s: String): Option[LogLevel]

    Returns the LogLevel associated with the given string, valid inputs are upper or lowercase (not mixed) versions of: "error", "warning", "info" and "debug"

  35. def loggerInitialized (): akka.event.Logging.LoggerInitialized.type

    Java API to create a LoggerInitialized message.

  36. def ne (arg0: AnyRef): Boolean

    Attributes
    final
    Definition Classes
    AnyRef
  37. def notify (): Unit

    Attributes
    final
    Definition Classes
    AnyRef
  38. def notifyAll (): Unit

    Attributes
    final
    Definition Classes
    AnyRef
  39. def stackTraceFor (e: Throwable): String

    Returns the StackTrace for the given Throwable as a String

  40. def synchronized [T0] (arg0: ⇒ T0): T0

    Attributes
    final
    Definition Classes
    AnyRef
  41. def toString (): String

    Definition Classes
    AnyRef → Any
  42. def wait (): Unit

    Attributes
    final
    Definition Classes
    AnyRef
    Annotations
    @throws()
  43. def wait (arg0: Long, arg1: Int): Unit

    Attributes
    final
    Definition Classes
    AnyRef
    Annotations
    @throws()
  44. def wait (arg0: Long): Unit

    Attributes
    final
    Definition Classes
    AnyRef
    Annotations
    @throws()
  45. val warningFormat : String

Inherited from AnyRef

Inherited from Any