Class Logging

java.lang.Object
org.apache.pekko.event.Logging

public class Logging extends Object
  • Constructor Details

    • Logging

      public Logging()
  • Method Details

    • simpleName

      public static String simpleName(Object obj)
    • simpleName

      public static String simpleName(Class<?> clazz)
    • messageClassName

      public static String messageClassName(Object message)
    • ErrorLevel

      public static final Logging.LogLevel ErrorLevel()
    • WarningLevel

      public static final Logging.LogLevel WarningLevel()
    • InfoLevel

      public static final Logging.LogLevel InfoLevel()
    • DebugLevel

      public static final Logging.LogLevel DebugLevel()
    • levelFor

      public static scala.Option<Logging.LogLevel> levelFor(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"
    • levelFor

      public static Logging.LogLevel levelFor(Class<? extends Logging.LogEvent> eventClass)
      Returns the LogLevel associated with the given event class. Defaults to DebugLevel.
    • classFor

      public static Class<? extends Logging.LogEvent> classFor(Logging.LogLevel level)
      Returns the event class associated with the given LogLevel
    • AllLogLevels

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

      public static <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 pekko.event.LogSource for details.

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

    • withMarker

      public static <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 pekko.event.LogSource for details.

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

    • apply

      public static <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 pekko.event.LogSource for details.

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

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

    • withMarker

      public static <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 pekko.event.LogSource for details.

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

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

    • apply

      public static 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
    • withMarker

      public static DiagnosticMarkerBusLoggingAdapter withMarker(Actor logSource)
    • getLogger

      public static LoggingAdapter getLogger(ActorSystem system, 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 pekko.event.LogSource for details.

    • getLogger

      public static LoggingAdapter getLogger(LoggingBus bus, 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 pekko.event.LogSource for details.

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

    • getLogger

      public static 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
    • noCause

      public static org.apache.pekko.event.Logging.Error.NoCause$ noCause()
    • loggerInitialized

      public static Logging.LoggerInitialized$ loggerInitialized()
    • StandardOutLogger

      public static Logging.StandardOutLogger StandardOutLogger()
    • stackTraceFor

      public static String stackTraceFor(Throwable e)
    • emptyMDC

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