Package akka.event

Class Logging$


  • public class Logging$
    extends java.lang.Object
    • Field Detail

      • MODULE$

        public static final Logging$ MODULE$
        Static reference to the singleton instance of this Scala object.
    • Constructor Detail

      • Logging$

        public Logging$()
    • Method Detail

      • simpleName

        public java.lang.String simpleName​(java.lang.Object obj)
      • simpleName

        public java.lang.String simpleName​(java.lang.Class<?> clazz)
      • messageClassName

        public java.lang.String messageClassName​(java.lang.Object message)
      • levelFor

        public scala.Option<Logging.LogLevel> levelFor​(java.lang.String s)
        Returns the LogLevel associated with the given string, valid inputs are upper or lowercase (not mixed) versions of: "error", "warning", "info" and "debug"
        Parameters:
        s - (undocumented)
        Returns:
        (undocumented)
      • levelFor

        public Logging.LogLevel levelFor​(java.lang.Class<? extends Logging.LogEvent> eventClass)
        Returns the LogLevel associated with the given event class. Defaults to DebugLevel.
        Parameters:
        eventClass - (undocumented)
        Returns:
        (undocumented)
      • classFor

        public java.lang.Class<? extends Logging.LogEvent> classFor​(Logging.LogLevel level)
        Returns the event class associated with the given LogLevel
        Parameters:
        level - (undocumented)
        Returns:
        (undocumented)
      • AllLogLevels

        public scala.collection.immutable.Seq<Logging.LogLevel> AllLogLevels()
      • apply

        public <T> LoggingAdapter apply​(ActorSystem system,
                                        T logSource,
                                        LogSource<T> evidence$3)
        Obtain LoggingAdapter for the given actor system and source object. This will use the system&rsquo;s event stream and include the system&rsquo;s address in the log source string.

        Do not use this if you want to supply a log category string (like &ldquo;com.example.app.whatever&rdquo;) 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.

        Parameters:
        system - (undocumented)
        logSource - (undocumented)
        evidence$3 - (undocumented)
        Returns:
        (undocumented)
      • withMarker

        public <T> MarkerLoggingAdapter withMarker​(ActorSystem system,
                                                   T logSource,
                                                   LogSource<T> evidence$4)
        Obtain LoggingAdapter with additional "marker" support (which some logging frameworks are able to utilise) for the given actor system and source object. This will use the system&rsquo;s event stream and include the system&rsquo;s address in the log source string.

        Do not use this if you want to supply a log category string (like &ldquo;com.example.app.whatever&rdquo;) 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.

        Parameters:
        system - (undocumented)
        logSource - (undocumented)
        evidence$4 - (undocumented)
        Returns:
        (undocumented)
      • apply

        public <T> LoggingAdapter apply​(LoggingBus bus,
                                        T logSource,
                                        LogSource<T> evidence$5)
        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.

        Note that this LoggingAdapter will use the DefaultLoggingFilter, and not the LoggingFilter configured for the system (if different from DefaultLoggingFilter).

        Parameters:
        bus - (undocumented)
        logSource - (undocumented)
        evidence$5 - (undocumented)
        Returns:
        (undocumented)
      • withMarker

        public <T> MarkerLoggingAdapter withMarker​(LoggingBus bus,
                                                   T logSource,
                                                   LogSource<T> evidence$6)
        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.

        Note that this LoggingAdapter will use the DefaultLoggingFilter, and not the LoggingFilter configured for the system (if different from DefaultLoggingFilter).

        Parameters:
        bus - (undocumented)
        logSource - (undocumented)
        evidence$6 - (undocumented)
        Returns:
        (undocumented)
      • apply

        public DiagnosticLoggingAdapter apply​(Actor logSource)
        Obtain LoggingAdapter with MDC support for the given actor. Don't use it outside its specific Actor as it isn't thread safe
        Parameters:
        logSource - (undocumented)
        Returns:
        (undocumented)
      • getLogger

        public LoggingAdapter getLogger​(ActorSystem system,
                                        java.lang.Object logSource)
        Obtain LoggingAdapter for the given actor system and source object. This will use the system&rsquo;s event stream and include the system&rsquo;s address in the log source string.

        Do not use this if you want to supply a log category string (like &ldquo;com.example.app.whatever&rdquo;) 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.

        Parameters:
        system - (undocumented)
        logSource - (undocumented)
        Returns:
        (undocumented)
      • getLogger

        public LoggingAdapter getLogger​(LoggingBus bus,
                                        java.lang.Object logSource)
        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.

        Note that this LoggingAdapter will use the DefaultLoggingFilter, and not the LoggingFilter configured for the system (if different from DefaultLoggingFilter).

        Parameters:
        bus - (undocumented)
        logSource - (undocumented)
        Returns:
        (undocumented)
      • getLogger

        public DiagnosticLoggingAdapter getLogger​(Actor logSource)
        Obtain LoggingAdapter with MDC support for the given actor. Don't use it outside its specific Actor as it isn't thread safe
        Parameters:
        logSource - (undocumented)
        Returns:
        (undocumented)
      • noCause

        public akka.event.Logging.Error.NoCause$ noCause()
      • stackTraceFor

        public java.lang.String stackTraceFor​(java.lang.Throwable e)
      • emptyMDC

        public scala.collection.immutable.Map<java.lang.String,​java.lang.Object> emptyMDC()
        LoggingAdapter extension which adds MDC support. Only recommended to be used within Actors as it isn't thread safe.
        Returns:
        (undocumented)